mirror of
https://github.com/sfilippone/amg4psblas.git
synced 2026-10-06 22:55:12 +00:00
Compare commits
154
Commits
l1-and-0-aggr
...
v1.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e627667f3c | ||
|
|
1557bcc45b | ||
|
|
786abaff97 | ||
|
|
06f8f83114 | ||
|
|
43a75e3171 | ||
|
|
2bde1beda2 | ||
|
|
7d110a88d0 | ||
|
|
f915372c99 | ||
|
|
b5df1842e0 | ||
|
|
a6267d8e67 | ||
|
|
498f8bd482 | ||
|
|
7aef98fc09 | ||
|
|
31a44360a4 | ||
|
|
83a668c1e0 | ||
|
|
c162633845 | ||
|
|
547c4f3a60 | ||
|
|
92766e743a | ||
|
|
212892e84a | ||
|
|
f9c0eec453 | ||
|
|
387d6bef74 | ||
|
|
d6550abc70 | ||
|
|
d95341b45a | ||
|
|
7da64944b5 | ||
|
|
daaa06e486 | ||
|
|
5ee819592f | ||
|
|
5408e16a4a | ||
|
|
372ef708e0 | ||
|
|
f4e1ba97e9 | ||
|
|
e429b04600 | ||
|
|
6c12de02e8 | ||
|
|
0cb2c1c0c6 | ||
|
|
7c153de54a | ||
|
|
00cf38906a | ||
|
|
23cf86a797 | ||
|
|
91bea72cfe | ||
|
|
9a36a321f2 | ||
|
|
60d722ec53 | ||
|
|
1b8aa1618e | ||
|
|
154e88cd69 | ||
|
|
cf93042e42 | ||
|
|
ecaea5b794 | ||
|
|
3a42a2597c | ||
|
|
fcf48ee614 | ||
|
|
0ddd35b7b6 | ||
|
|
4c19edb2f9 | ||
|
|
c7c02bf7c0 | ||
|
|
7050095ca5 | ||
|
|
b7edff0848 | ||
|
|
6214a918f1 | ||
|
|
b724a324c9 | ||
|
|
21b85bc533 | ||
|
|
3176a53a61 | ||
|
|
b246223597 | ||
|
|
2f4c9dd579 | ||
|
|
657986c938 | ||
|
|
687e0824e8 | ||
|
|
7abeb7d192 | ||
|
|
196cedfedb | ||
|
|
120da08860 | ||
|
|
70b28ddc08 | ||
|
|
22b37fa6d3 | ||
|
|
8fdff8e33b | ||
|
|
0d07a81aa7 | ||
|
|
64d2ead7a0 | ||
|
|
e762554627 | ||
|
|
b5e7d6aaaa | ||
|
|
886e03ab65 | ||
|
|
a0fc174c84 | ||
|
|
bbf5cc9826 | ||
|
|
8337edb362 | ||
|
|
a39cd229e0 | ||
|
|
a983f95fc2 | ||
|
|
aa03a1cafd | ||
|
|
f3123f1acc | ||
|
|
ed8b3d5c9e | ||
|
|
787b99b320 | ||
|
|
c07dad642f | ||
|
|
75f768028c | ||
|
|
afb5d9da76 | ||
|
|
b9cf9dca06 | ||
|
|
e922582aad | ||
|
|
9ad88b1355 | ||
|
|
0f425bdc06 | ||
|
|
d925d39089 | ||
|
|
92eb261ee5 | ||
|
|
5cf7d5b3c1 | ||
|
|
31644c972a | ||
|
|
cfd29707da | ||
|
|
9ded460701 | ||
|
|
da7a3be4e4 | ||
|
|
0b9ca017c6 | ||
|
|
6fa5b04387 | ||
|
|
5748358fe9 | ||
|
|
474f8e463e | ||
|
|
ac7d7373e6 | ||
|
|
20b3c30e24 | ||
|
|
f159f35eb2 | ||
|
|
886d539ffc | ||
|
|
2910ac6537 | ||
|
|
3b3a6c88a8 | ||
|
|
d61c9fed9f | ||
|
|
a8cf53d80e | ||
|
|
2efe639a19 | ||
|
|
b426a9ccf7 | ||
|
|
1feaf40972 | ||
|
|
cc66413be8 | ||
|
|
f6afacd1ff | ||
|
|
02bf24efa3 | ||
|
|
f6349d34d1 | ||
|
|
2e79105695 | ||
|
|
921535c3c9 | ||
|
|
557809755e | ||
|
|
64105a17c5 | ||
|
|
67c32da222 | ||
|
|
f317a571f4 | ||
|
|
b075182ce6 | ||
|
|
be469f8844 | ||
|
|
04bcf04a9c | ||
|
|
725e39586d | ||
|
|
e68304e84f | ||
|
|
3972f27eb5 | ||
|
|
b21e5aebab | ||
|
|
6e2d61b51e | ||
|
|
4ee170f0ec | ||
|
|
4a9f8e9da0 | ||
|
|
94caab8aa9 | ||
|
|
749ab2f6ae | ||
|
|
bf96dd554c | ||
|
|
1aef82023c | ||
|
|
161b93da64 | ||
|
|
8d4af1ba9f | ||
|
|
cd87bdb0c1 | ||
|
|
53afa87814 | ||
|
|
13c99a0c3f | ||
|
|
1aa7c8db59 | ||
|
|
36b57eec24 | ||
|
|
417f8beaf9 | ||
|
|
d66bf1e2f8 | ||
|
|
c590a4088a | ||
|
|
80dfd1ad3b | ||
|
|
857844474a | ||
|
|
a85997926c | ||
|
|
70fb39ae55 | ||
|
|
82de529c54 | ||
|
|
db9757a45e | ||
|
|
5b654cc221 | ||
|
|
d518f5eac7 | ||
|
|
053d5c4bc0 | ||
|
|
032543d625 | ||
|
|
07149a02ad | ||
|
|
08a0c744b1 | ||
|
|
60324084d8 | ||
|
|
aec5a52c7f | ||
|
|
b5f5d356fd |
@@ -5,6 +5,7 @@
|
||||
|
||||
# header files generated
|
||||
cbind/*.h
|
||||
amgprec/amg_config.h
|
||||
|
||||
# Make.inc generated
|
||||
/Make.inc
|
||||
@@ -20,3 +21,5 @@ autom4te.cache
|
||||
# the executable from tests
|
||||
runs
|
||||
|
||||
# Documentation temporary files
|
||||
docs/src/userguide.pdf
|
||||
|
||||
+542
@@ -0,0 +1,542 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(amg4psblas VERSION 1.0 LANGUAGES C CXX Fortran)
|
||||
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
|
||||
|
||||
|
||||
set(PSBLAS_INSTALL_DIR "" CACHE PATH "Path to the PSBLAS installation
|
||||
directory")
|
||||
if(PSBLAS_INSTALL_DIR STREQUAL "")
|
||||
message(FATAL_ERROR "Please specify the path to the PSBLAS installation directory using -DPSBLAS_INSTALL_DIR=<path> or set it in ccmake.")
|
||||
endif()
|
||||
|
||||
|
||||
# Check for the installation path for psblas
|
||||
#if(NOT DEFINED PSBLAS_INSTALL_DIR)
|
||||
# message(FATAL_ERROR "Please specify the path to the psblas installation directory using -DPSBLAS_INSTALL_DIR=<path>")
|
||||
#endif()
|
||||
message(STATUS "psblas directory is ${PSBLAS_INSTALL_DIR};;")
|
||||
|
||||
|
||||
message(STATUS "PSBLAS DIRECTORY INC ${INCDIR}; MOD ${MODDIR}; LIB ${LIBDIR};")
|
||||
|
||||
|
||||
#set(CMAKE_CXX_STANDARD 17) # Set cxx standard for the c++ part of the library
|
||||
|
||||
|
||||
# Find the psblas package
|
||||
find_package(psblas REQUIRED PATHS ${PSBLAS_INSTALL_DIR})
|
||||
|
||||
if(NOT psblas_FOUND)
|
||||
message(FATAL_ERROR "PSBLAS not found!")
|
||||
else()
|
||||
message(STATUS "Found PSBLAS: ${psblas_LIBRARIES}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# Add -g to the Fortran compiler flags.
|
||||
# We use STRING(APPEND) to ensure we don't overwrite other important flags.
|
||||
string(APPEND CMAKE_Fortran_FLAGS " -g")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -g")
|
||||
message(STATUS "Fortran and CXX debug flags added: -g")
|
||||
endif()
|
||||
|
||||
string(APPEND CMAKE_Fortran_FLAGS " -O2")
|
||||
string(APPEND CMAKE_CXX_FLAGS " -O2")
|
||||
message(STATUS "Fortran and CXX optimization flags added: -O2")
|
||||
|
||||
|
||||
|
||||
# Set the include and library directories based on the provided path
|
||||
#set(TEST_INSTALLDIR "${PSBLAS_INSTALL_DIR}")
|
||||
set(INCDIR "${PSBLAS_INSTALL_DIR}/${PSB_CMAKE_INSTALL_INCLUDEDIR}")
|
||||
set(MODDIR "${PSBLAS_INSTALL_DIR}/${PSB_CMAKE_INSTALL_MODULDIR}")
|
||||
set(LIBDIR "${PSBLAS_INSTALL_DIR}/${PSB_CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
|
||||
# Include directories for the project
|
||||
include_directories(${PSBLAS_INSTALL_DIR} ${MPI_INCLUDE_PATH} )
|
||||
|
||||
|
||||
# Include directories for the Fortran compiler
|
||||
include_directories(${INCDIR} ${MODDIR} ${LIBDIR})
|
||||
|
||||
|
||||
|
||||
message(STATUS "Using IPK size: ${PSB_IPK_SIZE}")
|
||||
message(STATUS "Using LPK size: ${PSB_LPK_SIZE}")
|
||||
|
||||
# Add PSB_IPK/LPK flag only for fortran files.
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_IPK${PSB_IPK_SIZE}")
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DPSB_LPK${PSB_LPK_SIZE}")
|
||||
|
||||
|
||||
|
||||
|
||||
# Specify the installation directory
|
||||
|
||||
#set(${CMAKE_INSTALL_LIBDIR} "lib")
|
||||
#message(STATUS "\t\t install libdir ${CMAKE_INSTALL_LIBDIR};")
|
||||
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${${CMAKE_PROJECT_NAME}_dist_string}-tests")
|
||||
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
|
||||
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
|
||||
|
||||
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/${${CMAKE_PROJECT_NAME}_dist_string}-tests")
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
||||
#set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory")
|
||||
#set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "Include directory")
|
||||
#set(CMAKE_INSTALL_MODULDIR "modules" CACHE STRING "Module directory")
|
||||
|
||||
message(STATUS "Initial CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR}")
|
||||
set(AMG_CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
if(NOT AMG_CMAKE_INSTALL_LIBDIR)
|
||||
message(STATUS "CMAKE_INSTALL_LIBDIR is set to default value lib")
|
||||
#set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory" FORCE)
|
||||
set(CMAKE_INSTALL_LIBDIR ${PSB_CMAKE_INSTALL_LIBDIR})
|
||||
set(AMG_CMAKE_INSTALL_LIBDIR ${PSB_CMAKE_INSTALL_LIBDIR})
|
||||
else()
|
||||
set(CMAKE_INSTALL_LIBDIR ${AMG_CMAKE_INSTALL_LIBDIR})
|
||||
message(STATUS "CMAKE_INSTALL_LIBDIR is set to: ${CMAKE_INSTALL_LIBDIR}")
|
||||
endif()
|
||||
|
||||
if(NOT AMG_CMAKE_INSTALL_INCLUDEDIR)
|
||||
message(STATUS "CMAKE_INSTALL_INCLUDEDIR is set to default value lib")
|
||||
#set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "Include directory" FORCE)
|
||||
set(CMAKE_INSTALL_INCLUDEDIR ${PSB_CMAKE_INSTALL_INCLUDEDIR})
|
||||
set(AMG_CMAKE_INSTALL_INCLUDEDIR ${PSB_CMAKE_INSTALL_INCLUDEDIR})
|
||||
else()
|
||||
set(CMAKE_INSTALL_INCLUDEDIR ${AMG_CMAKE_INSTALL_INCLUDEDIR})
|
||||
message(STATUS "CMAKE_INSTALL_INCLUDEDIR is set to: ${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
if(NOT AMG_CMAKE_INSTALL_MODULDIR)
|
||||
message(STATUS "CMAKE_INSTALL_MODULDIR is set to default value lib")
|
||||
#set(CMAKE_INSTALL_MODULDIR "modules" CACHE STRING "Modules directory" FORCE)
|
||||
set(CMAKE_INSTALL_MODULDIR ${PSB_CMAKE_INSTALL_MODULDIR})
|
||||
set(AMG_CMAKE_INSTALL_LIBDIR ${PSB_CMAKE_INSTALL_MODULDIR})
|
||||
else()
|
||||
set(CMAKE_INSTALL_MODULDIR ${AMG_CMAKE_INSTALL_MODULDIR})
|
||||
message(STATUS "CMAKE_INSTALL_MODULDIR is set to: ${CMAKE_INSTALL_MODULDIR}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Publicize installed location to other CMake projects
|
||||
#-----------------------------------------------------
|
||||
#install(EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
# DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
|
||||
#)
|
||||
|
||||
|
||||
message(STATUS "NAME project ${CMAKE_PROJECT_NAME};")
|
||||
|
||||
install(EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
FILE ${CMAKE_PROJECT_NAME}Config.cmake
|
||||
NAMESPACE ${CMAKE_PROJECT_NAME}::
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake"
|
||||
)
|
||||
|
||||
|
||||
include(CMakePackageConfigHelpers) # standard CMake module
|
||||
write_basic_package_version_file(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
|
||||
VERSION "${amg4psblas_VERSION}"
|
||||
COMPATIBILITY SameMajorVersion
|
||||
)
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CMAKE_PROJECT_NAME}Config.cmake" @ONLY)
|
||||
|
||||
install(
|
||||
FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${CMAKE_PROJECT_NAME}Config.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake"
|
||||
DESTINATION
|
||||
"${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#------------------------------------------
|
||||
# Add portable unistall command to makefile
|
||||
#------------------------------------------
|
||||
# Adapted from the CMake Wiki FAQ
|
||||
configure_file ( "${CMAKE_SOURCE_DIR}/cmake/uninstall.cmake.in" "${CMAKE_BINARY_DIR}/uninstall.cmake"
|
||||
@ONLY)
|
||||
|
||||
add_custom_target ( uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_BINARY_DIR}/uninstall.cmake" )
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
||||
# See JSON-Fortran's CMakeLists.txt file to find out how to get the check target to depend
|
||||
# on the test executables
|
||||
|
||||
#----------------------------------
|
||||
# Determine if we're using Open MPI
|
||||
#---------------------------------
|
||||
|
||||
|
||||
|
||||
find_package( MPI REQUIRED Fortran C CXX )
|
||||
|
||||
if(MPI_FOUND)
|
||||
#-----------------------------------------------
|
||||
# Work around an issue present on fedora systems
|
||||
#-----------------------------------------------
|
||||
if( (MPI_CXX_LINK_FLAGS MATCHES "noexecstack") OR (MPI_Fortran_LINK_FLAGS MATCHES "noexecstack") )
|
||||
message ( WARNING
|
||||
"The `noexecstack` linker flag was found in the MPI_<lang>_LINK_FLAGS variable. This is
|
||||
known to cause segmentation faults for some Fortran codes. See, e.g.,
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71729 or
|
||||
https://github.com/sourceryinstitute/OpenCoarrays/issues/317.
|
||||
|
||||
`noexecstack` is being replaced with `execstack`"
|
||||
)
|
||||
string(REPLACE "noexecstack"
|
||||
"execstack" MPI_CXX_LINK_FLAGS_FIXED ${MPI_CXX_LINK_FLAGS})
|
||||
string(REPLACE "noexecstack"
|
||||
"execstack" MPI_C_LINK_FLAGS_FIXED ${MPI_C_LINK_FLAGS})
|
||||
string(REPLACE "noexecstack"
|
||||
"execstack" MPI_Fortran_LINK_FLAGS_FIXED ${MPI_Fortran_LINK_FLAGS})
|
||||
set(MPI_CXX_LINK_FLAGS "${MPI_CXX_LINK_FLAGS_FIXED}" CACHE STRING
|
||||
"MPI CXX linking flags" FORCE)
|
||||
set(MPI_C_LINK_FLAGS "${MPI_C_LINK_FLAGS_FIXED}" CACHE STRING
|
||||
"MPI C linking flags" FORCE)
|
||||
set(MPI_Fortran_LINK_FLAGS "${MPI_Fortran_LINK_FLAGS_FIXED}" CACHE STRING
|
||||
"MPI Fortran linking flags" FORCE)
|
||||
|
||||
endif()
|
||||
|
||||
message(STATUS "Found MPI: ${MPI_C_LIBRARIES} - ${MPI_CXX_LIBRARIES} - ${MPI_Fortran_LIBRARIES}")
|
||||
|
||||
|
||||
#----------------
|
||||
# Setup MPI compilers
|
||||
#----------------
|
||||
set(CMAKE_C_COMPILER ${MPI_C_COMPILER} CACHE FILEPATH "C compiler" FORCE)
|
||||
set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER} CACHE FILEPATH "C++ compiler" FORCE)
|
||||
set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER} CACHE FILEPATH "Fortran compiler" FORCE)
|
||||
|
||||
#----------------
|
||||
# Setup MPI flags
|
||||
#----------------
|
||||
list(REMOVE_DUPLICATES MPI_Fortran_INCLUDE_PATH)
|
||||
set(CMAKE_C_COMPILE_FLAGS ${CMAKE_C_COMPILE_FLAGS} ${MPI_C_COMPILE_FLAGS})
|
||||
set(CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS} ${MPI_C_LINK_FLAGS})
|
||||
set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_CXX_COMPILE_FLAGS})
|
||||
set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_CXX_LINK_FLAGS})
|
||||
set(CMAKE_Fortran_COMPILE_FLAGS ${CMAKE_Fortran_COMPILE_FLAGS} ${MPI_Fortran_COMPILE_FLAGS})
|
||||
set(CMAKE_Fortran_LINK_FLAGS ${CMAKE_Fortran_LINK_FLAGS} ${MPI_Fortran_LINK_FLAGS})
|
||||
include_directories(BEFORE ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH} ${MPI_Fortran_INCLUDE_PATH})
|
||||
message(STATUS "${MPI_C_INCLUDE_PATH}; ${MPI_Fortran_INCLUDE_PATH};; ${CMAKE_Fortran_LINK_FLAGS} ;")
|
||||
if(MPI_Fortran_HAVE_F90_MODULE OR MPI_Fortran_HAVE_F08_MODULE)
|
||||
add_compile_options(-DPSB_MPI_MOD)
|
||||
message(STATUS "-DPSB_MPI_MOD")
|
||||
#add_compile_options(-DSERIAL_MPI) # Is it right??
|
||||
#message(STATUS "-DSERIAL_MPI")
|
||||
endif()
|
||||
set(PSB_SERIAL_MPI OFF)
|
||||
|
||||
else()
|
||||
message(STATUS "MPI not found, serial ahead")
|
||||
add_compile_options(-DPSB_SERIAL_MPI)
|
||||
add_compile_options(-DPSB_MPI_MOD)
|
||||
set(PSB_SERIAL_MPI ON)
|
||||
set(CSERIALMPI "#define PSB_SERIAL_MPI")
|
||||
endif()
|
||||
|
||||
add_compile_options(-O3)
|
||||
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-frecursive>)
|
||||
|
||||
if(MPI_FOUND)
|
||||
execute_process(COMMAND ${MPIEXEC} --version
|
||||
OUTPUT_VARIABLE mpi_version_out)
|
||||
if (mpi_version_out MATCHES "[Oo]pen[ -][Mm][Pp][Ii]")
|
||||
message( STATUS "OpenMPI detected")
|
||||
set ( openmpi true )
|
||||
endif()
|
||||
|
||||
|
||||
set(MPI_H_COPIED FALSE)
|
||||
set(MPI_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/include") # Define the include directory
|
||||
|
||||
# Create the include directory if it doesn't exist
|
||||
file(MAKE_DIRECTORY "${MPI_INCLUDE_DIR}")
|
||||
|
||||
foreach(path IN LISTS MPI_INCLUDE_PATH)
|
||||
# Construct the full path to the mpi.h file
|
||||
set(mpi_h_path "${path}/mpi.h")
|
||||
|
||||
# Check if the mpi.h file exists
|
||||
if(EXISTS "${mpi_h_path}")
|
||||
# Copy the mpi.h file to the include directory
|
||||
file(COPY "${mpi_h_path}" DESTINATION "${MPI_INCLUDE_DIR}")
|
||||
message(STATUS "Copied mpi.h from ${mpi_h_path} to ${MPI_INCLUDE_DIR}")
|
||||
set(MPI_H_COPIED TRUE)
|
||||
break() # Exit the loop once we've copied the file
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(NOT MPI_H_COPIED)
|
||||
message(WARNING "mpi.h not found in any of the specified paths: ${MPI_INCLUDE_PATH}")
|
||||
endif()
|
||||
|
||||
# Add the created include directory to the project's include directories
|
||||
#include_directories("${MPI_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
#------------------------------------------
|
||||
# Configure the amg_config.h file
|
||||
#------------------------------------------
|
||||
|
||||
message(STATUS "bin dir ${CMAKE_CURRENT_BINARY_DIR}; source dir ${CMAKE_CURRENT_SOURCE_DIR};;")
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/amgprec/amg_config.h.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/amg_config.h
|
||||
@ONLY # Replace variables only
|
||||
)
|
||||
|
||||
|
||||
|
||||
#---------------------------------------
|
||||
# Add the AMG libraries
|
||||
#---------------------------------------
|
||||
|
||||
# In your CMakeLists.txt
|
||||
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-256")
|
||||
|
||||
message(STATUS "MPI_LIBRARIES: ${MPI_LIBRARIES}")
|
||||
message(STATUS "MPI_CXX_LIBRARIES: ${MPI_CXX_LIBRARIES}")
|
||||
|
||||
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/amgprec/CMakeLists.txt) # include amgprec_source_files and amgprec_source_C_files source files
|
||||
|
||||
include_directories("${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
add_library(amgprec_C OBJECT ${amgprec_source_C_files})
|
||||
add_library(amgprec_CPP OBJECT ${amgprec_source_CPP_files})
|
||||
|
||||
target_link_libraries(amgprec_C
|
||||
#PUBLIC ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ${LAPACK95_LIBRARIES}
|
||||
#PUBLIC ${BLAS_LINKER_FLAGS} ${BLAS_LIBRARIES} ${BLAS95_LIBRARIES}
|
||||
psblas::util psblas::linsolve psblas::prec psblas::ext psblas::cbind psblas::base
|
||||
#${MPI_C_LIBRARIES}
|
||||
) #TODO check actual libraries needed
|
||||
|
||||
target_link_libraries(amgprec_CPP
|
||||
#PUBLIC ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ${LAPACK95_LIBRARIES}
|
||||
#PUBLIC ${BLAS_LINKER_FLAGS} ${BLAS_LIBRARIES} ${BLAS95_LIBRARIES}
|
||||
psblas::util psblas::linsolve psblas::prec psblas::ext psblas::cbind psblas::base
|
||||
stdc++
|
||||
${MPI_CXX_LIBRARIES}) #TODO check actual libraries needed
|
||||
|
||||
add_library(amgprec ${amgprec_source_files} $<TARGET_OBJECTS:amgprec_CPP> $<TARGET_OBJECTS:amgprec_C> )
|
||||
|
||||
set_target_properties(amgprec
|
||||
PROPERTIES
|
||||
Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/modules"
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
OUTPUT_NAME amg_prec
|
||||
LINKER_LANGUAGE Fortran
|
||||
)
|
||||
|
||||
target_include_directories(amgprec PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/modules>
|
||||
$<INSTALL_INTERFACE:modules>)
|
||||
|
||||
message(STATUS "include dir := ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
#target_include_directories(base PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY})
|
||||
|
||||
target_include_directories(amgprec PUBLIC ${INCDIR} ${MODDIR})
|
||||
target_link_libraries(amgprec
|
||||
#PUBLIC ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ${LAPACK95_LIBRARIES}
|
||||
#PUBLIC ${BLAS_LINKER_FLAGS} ${BLAS_LIBRARIES} ${BLAS95_LIBRARIES}
|
||||
psblas::util psblas::linsolve psblas::prec psblas::ext psblas::cbind psblas::base
|
||||
#${MPI_Fortran_LIBRARIES} ${MPI_CXX_LIBRARIES} ${MPI_C_LIBRARIES}
|
||||
) #TODO check actual libraries needed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/cbind/CMakeLists.txt) # include amgprec_source_files and amgprec_source_C_files source files
|
||||
|
||||
|
||||
foreach(path IN LISTS amgcbind_header_C_files)
|
||||
# Copy the header file to the include directory
|
||||
file(COPY "${path}" DESTINATION "${CMAKE_BINARY_DIR}/include")
|
||||
endforeach()
|
||||
|
||||
|
||||
add_library(amgcbind_C OBJECT ${amgcbind_source_C_files})
|
||||
|
||||
target_link_libraries(amgcbind_C
|
||||
#PUBLIC ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ${LAPACK95_LIBRARIES}
|
||||
#PUBLIC ${BLAS_LINKER_FLAGS} ${BLAS_LIBRARIES} ${BLAS95_LIBRARIES}
|
||||
psblas::util psblas::linsolve psblas::prec psblas::ext psblas::cbind psblas::base) #TODO check actual libraries needed
|
||||
|
||||
add_library(amgcbind ${amgcbind_source_files} $<TARGET_OBJECTS:amgcbind_C>)
|
||||
|
||||
set_target_properties(amgcbind
|
||||
PROPERTIES
|
||||
Fortran_MODULE_DIRECTORY "${CMAKE_BINARY_DIR}/modules"
|
||||
POSITION_INDEPENDENT_CODE TRUE
|
||||
OUTPUT_NAME amg_cbind
|
||||
LINKER_LANGUAGE Fortran
|
||||
)
|
||||
|
||||
target_include_directories(amgcbind PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/modules>
|
||||
$<INSTALL_INTERFACE:modules>)
|
||||
|
||||
message(STATUS "include dir := ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
#target_include_directories(base PUBLIC ${CMAKE_Fortran_MODULE_DIRECTORY})
|
||||
|
||||
target_include_directories(amgcbind PUBLIC ${INCDIR} ${MODDIR})
|
||||
target_link_libraries(amgcbind
|
||||
#PUBLIC ${LAPACK_LINKER_FLAGS} ${LAPACK_LIBRARIES} ${LAPACK95_LIBRARIES}
|
||||
#PUBLIC ${BLAS_LINKER_FLAGS} ${BLAS_LIBRARIES} ${BLAS95_LIBRARIES}
|
||||
PUBLIC amgprec psblas::util psblas::linsolve psblas::prec psblas::ext psblas::cbind psblas::base) #TODO check actual libraries needed
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
FILES_MATCHING PATTERN "*.h")
|
||||
|
||||
install(DIRECTORY ${CMAKE_BINARY_DIR}/modules/ DESTINATION "${CMAKE_INSTALL_MODULDIR}"
|
||||
FILES_MATCHING PATTERN "*.mod")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Install the library
|
||||
install(TARGETS amgprec amgcbind
|
||||
EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
||||
|
||||
|
||||
|
||||
if(WIN32) #TODO
|
||||
# install(TARGETS psb_base_C
|
||||
# EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
# DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
# LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
# )
|
||||
# if(METIS_FOUND)
|
||||
# install(TARGETS psb_util_C
|
||||
# EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
# DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
# LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
# )
|
||||
# endif()
|
||||
endif()
|
||||
|
||||
|
||||
message(STATUS "install directory is ${CMAKE_INSTALL_LIBDIR};;;")
|
||||
|
||||
# Step 2: Create the configuration file from the template
|
||||
#configure_package_config_file(
|
||||
# "${CMAKE_CURRENT_SOURCE_DIR}/cmake/amg4psblasConfig.cmake.in"
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/amg4psblasConfig.cmake"
|
||||
# INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/amg4psblas"
|
||||
#)
|
||||
|
||||
# Step 3: Install the generated config files
|
||||
#install(FILES
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/amg4psblasConfig.cmake"
|
||||
# "${CMAKE_CURRENT_BINARY_DIR}/amg4psblasConfigVersion.cmake"
|
||||
# DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/amg4psblas"
|
||||
#)
|
||||
|
||||
# Step 4: Export targets so that the build directory can be used directly
|
||||
#export(
|
||||
# EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
# FILE "${CMAKE_CURRENT_BINARY_DIR}/amg4psblasTargets.cmake"
|
||||
# NAMESPACE psblas::
|
||||
#)
|
||||
export(
|
||||
EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake"
|
||||
NAMESPACE ${CMAKE_PROJECT_NAME}::
|
||||
)
|
||||
|
||||
#export(
|
||||
# EXPORT ${CMAKE_PROJECT_NAME}-targets
|
||||
# FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake"
|
||||
# NAMESPACE ${CMAKE_PROJECT_NAME}::
|
||||
#)
|
||||
|
||||
|
||||
|
||||
|
||||
# Set the installation directory for the test files
|
||||
set(INSTALL_TEST_DIR "${CMAKE_INSTALL_PREFIX}/samples" CACHE PATH "Installation directory for sample files")
|
||||
|
||||
function(install_directory_recursive source_dir install_base_dir) # Function to install a directory and its subdirectories recursively
|
||||
file(GLOB_RECURSE ALL_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}" "${source_dir}/*")
|
||||
|
||||
foreach(FILE_PATH IN LISTS ALL_FILES)
|
||||
# Construct the full source and destination paths
|
||||
set(FULL_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${source_dir}/${FILE_PATH}")
|
||||
set(FULL_INSTALL_PATH "${install_base_dir}/${FILE_PATH}")
|
||||
|
||||
# Check if it's a directory
|
||||
if(IS_DIRECTORY "${FULL_SOURCE_PATH}")
|
||||
# Create the directory in the install destination
|
||||
file(MAKE_DIRECTORY "${FULL_INSTALL_PATH}")
|
||||
else()
|
||||
# Install the file
|
||||
install(FILES "${FULL_SOURCE_PATH}" DESTINATION "${install_base_dir}" RENAME "${FILE_PATH}")
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
|
||||
|
||||
# Install test/fileread directory
|
||||
install_directory_recursive(samples/simple "${INSTALL_TEST_DIR}/simple")
|
||||
|
||||
# Install test/pdegen directory
|
||||
install_directory_recursive(samples/advanced "${INSTALL_TEST_DIR}/advanced")
|
||||
|
||||
|
||||
|
||||
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} - ${PSB_CMAKE_INSTALL_PREFIX};")
|
||||
message(STATUS "CMAKE_INSTALL_LIBDIR: ${CMAKE_INSTALL_LIBDIR} - ${PSB_CMAKE_INSTALL_LIBDIR};")
|
||||
message(STATUS "CMAKE_INSTALL_INCLUDEDIR: ${CMAKE_INSTALL_INCLUDEDIR} - ${PSB_CMAKE_INSTALL_INCLUDEDIR};")
|
||||
message(STATUS "CMAKE_INSTALL_MODULDIR: ${CMAKE_INSTALL_MODULDIR} - ${PSB_CMAKE_INSTALL_MODULDIR};")
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
Changelog. A lot less detailed than usual, at least for past
|
||||
history.
|
||||
2022/05/20: Restart ChangeLog. Updated to new name AMG4PSBLAS, now using PSB3.8
|
||||
2018/10/28: Fix interface to MUMPS and configry machinery. Require PSB 3.6.
|
||||
2018/10/10: ICTXT argument in prec%init().
|
||||
2018/07/30: Fixes for Intel compilers. BootCMatch interface in examples.
|
||||
2018/05/14: Interface for extension of aggregation methods.
|
||||
2018/02/28: New cartesian distribution for sample programs.
|
||||
2017/12/15: New WRK component of preconditioner levels, preallocation.
|
||||
2017/10/25: New example input file formats. Added sample matrices.
|
||||
2017/10/02: New CBIND in PSBLAS 3.5.0
|
||||
2017/07/30: Refactored examples. Change default thresholds.
|
||||
2017/05/31: New internal description of ML.
|
||||
2017/05/16: Improve build process.
|
||||
2017/04/20: Force %set interface. Update docs.
|
||||
2017/04/03: Remove obsolete stuff.
|
||||
2017/03/17: Fixed level%cnv; add coarse _solver tracker.
|
||||
2017/02/18: Take out clean_zeros; changed NOFILTER; defined FBGS; take out
|
||||
n_prec_levs.
|
||||
2017/02/12: Updated mat_dist usage, dubious SP shell for UMFPACK, fixes
|
||||
for RPM packaging.
|
||||
2017/02/02: Fix superlu configury
|
||||
2016/11/12: Fix hierarchy/smoothers build to handle 1 level.
|
||||
2016/10/03: Merged changes to hierearchy building.
|
||||
2016/08/20: Reimplemented decoupled aggregation
|
||||
2016/07/20: Refactored application of multilevel. Defined V,W and
|
||||
K-cycles.
|
||||
2016/05/18: Reworked internals of PRECSET. Defined Forward-Backward
|
||||
Gauss-Seidel solver. Now available separate PRE and POST smoother
|
||||
objects.
|
||||
2016/03/30: MUMPS interface.
|
||||
2016/02/28: Hybrid Gauss-Seidel method.
|
||||
2016/02/03: unify integer argument checks.
|
||||
2015/12/15: defaults single vs. double precision. Use clean_zeros.
|
||||
2015/12/08: new matdist interface
|
||||
2015/10/17: configry fixes
|
||||
2015/10/13: Fixes for SLUDIST versions 3 and 4
|
||||
2015/05/03: New heap interface
|
||||
2015/04/21: INTENT fixes
|
||||
|
||||
2014/12/21: New error handling
|
||||
|
||||
2014/10/27: Added versioncheck to configure.
|
||||
|
||||
2014/03/31: New get_diag.
|
||||
|
||||
2013/11/07: Merged changes from experimental branch. Fix INCDIR in
|
||||
makefiles.
|
||||
|
||||
2013/07/15: Fixes for UMFPACK 5.4, SuperLU 4.3, SuperLU_Dist 3.3
|
||||
|
||||
2013/04/05: CLONE method.
|
||||
|
||||
2013/03/08: Reworked SET routines.
|
||||
|
||||
2012/12/10: Enable long_integers.
|
||||
|
||||
2012/12/05: Split smoother/solver objects.
|
||||
|
||||
2012/04/30: New scheme to find dynamically the number of level based on
|
||||
the size of the coarse matrix
|
||||
|
||||
2012/01/10: Done split interface/implementation, plus subdir restructure.
|
||||
|
||||
2011/12/13: Start split interface/implementation to improve build time.
|
||||
|
||||
2011/11/25: Now works with _vect methods from PSBLAS.
|
||||
|
||||
2011/10/24: New test generation methods.
|
||||
|
||||
2011/06/15: Dump prolongator/restrictor
|
||||
|
||||
2011/04/14: Added MOLD argument(s) to precbld.
|
||||
|
||||
2011/03/30: Fixed: descriptive methods, example programs.
|
||||
|
||||
2011/03/08: Re-factored modules for ILU methods.
|
||||
|
||||
2011/03/04: Make X intent(inout) in APPLY to allow for preconditioners
|
||||
using SPMM.
|
||||
|
||||
2011/03/02: New set methods.
|
||||
|
||||
2011/01/07: Fixed UMF interfacing for Z data.
|
||||
|
||||
2011/01/04: Added UMF inteface for D data.
|
||||
|
||||
2011/01/02: Fix usage of DESC_DATA. Switched all names to F90 ending.
|
||||
|
||||
2010/12/16: Fix usage of replicated space descriptor.
|
||||
|
||||
2010/11/16: Fix Jacobi smoother in case of empty off-diagonal.
|
||||
|
||||
2010/11/04: Defined and tested single real and complex.
|
||||
|
||||
2010/11/02: Aligned usage of sparse data type with psblas3.
|
||||
|
||||
2009/12/22: Aligned constants with mld2p4 v1.2
|
||||
|
||||
2009/12/11: First working version of double multilevel.
|
||||
|
||||
2009/12/05: Inttroduction of Smoother/Solver object hierarchy.
|
||||
|
||||
2009/09/23: Initial F2003 version.
|
||||
|
||||
|
||||
2009/01/28: Changed names from XbaseprcY to XbaseprecY.
|
||||
2009/01/27: Changed names from mld_transfer to mld_move_alloc.
|
||||
|
||||
2009/01/13: Repackaged the one-level preconditioners. Reorganized the
|
||||
build routines, taking out mlprec_bld, and switching the
|
||||
number of levels when needed.
|
||||
2008/10/27: Changed the definition of prec_type: repackaged with a
|
||||
onelev-prec-type, containing a baseprec and maps between
|
||||
index spaces. No performance impact; no changes to
|
||||
user-level interfaces.
|
||||
|
||||
2008/09/18: Changed mld_sizeof to integer(8); updated samples.
|
||||
|
||||
2008/08/26: Fixed matrix generation in sample programs.
|
||||
|
||||
2008/07/25: missing implicit none in mld_prec_type.
|
||||
|
||||
2008/07/23: added HTML documentation
|
||||
|
||||
2008/06/13: Fixed aggregation for replicated index spaces.
|
||||
|
||||
2008/06/02: Threshold into decoupled aggregation algorithm.
|
||||
|
||||
2008/05/27: Single precision version.
|
||||
|
||||
2008/03/09: Introduced configure script.
|
||||
|
||||
2008/02/08: Merged changes from intermesh branch: we now have an
|
||||
inter_desc_type object. Cleaned up data allocation and
|
||||
variable initialization in multilevel prec application.
|
||||
|
||||
2008/01/10: Merged various fixes for: prologues, unused variables,
|
||||
interface details.
|
||||
2007/12/21: Merge version with prologues and internal docs.
|
||||
|
||||
2007/11/15: Created pargen example.
|
||||
|
||||
2007/11/14: Fix INTENT(IN) on X vector in preconditioner routines.
|
||||
|
||||
2007/10/19: Merged in ILU(P,T). To be tested extensively.
|
||||
|
||||
2007/10/17: Merged ILU(K) into trunk.
|
||||
|
||||
2007/10/16: Fixed ILU(K), it now performs satisfactorily. Also updated
|
||||
ILU(0) to be more legible.
|
||||
|
||||
2007/10/11: First working version of ILU(K). Still slow, there should
|
||||
be room for improvement.
|
||||
|
||||
2007/10/09: Added benchmark code.
|
||||
|
||||
2007/10/09: Added MILU_N_. Beware: values for UMF_ etc. have been
|
||||
shifted.
|
||||
|
||||
2007/10/02: To do: decide whether to name MLD_KRYLOV_MOD or
|
||||
PSB_KRYLOV_MOD.
|
||||
|
||||
2007/10/01: Start of this changelog. MLD2P4 now has a different
|
||||
structure, to enable a build not embedded in PSBLAS.
|
||||
@@ -1,10 +1,10 @@
|
||||
|
||||
|
||||
AMG4PSBLAS version 1.1
|
||||
AMG4PSBLAS version 1.2
|
||||
Algebraic Multigrid Package
|
||||
based on PSBLAS (Parallel Sparse BLAS version 3.8)
|
||||
based on PSBLAS (Parallel Sparse BLAS version 3.9)
|
||||
|
||||
(C) Copyright 2022
|
||||
(C) Copyright 2025
|
||||
|
||||
Salvatore Filippone
|
||||
Pasqua D'Ambra
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ PSBLAS_INCLUDES=@PSBLAS_INCLUDES@
|
||||
PSBLAS_LIBS=@PSBLAS_LIBS@
|
||||
PSBBASEMODNAME=psb_base_mod
|
||||
PSBPRECMODNAME=psb_prec_mod
|
||||
PSBMETHDMODNAME=psb_krylov_mod
|
||||
PSBMETHDMODNAME=psb_linsolve_mod
|
||||
PSBUTILMODNAME=psb_util_mod
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
include Make.inc
|
||||
|
||||
|
||||
all: objs lib
|
||||
|
||||
objs: libdir amgp cbnd
|
||||
all: mods objs lib
|
||||
|
||||
objs: libdir mods amgobjs cbnd
|
||||
mods: libdir
|
||||
cd amgprec && $(MAKE) mods
|
||||
lib: objs
|
||||
cd amgprec && $(MAKE) lib
|
||||
cd cbind && $(MAKE) lib
|
||||
@@ -15,13 +16,13 @@ libdir:
|
||||
(if test ! -d modules ; then mkdir modules; fi;)
|
||||
($(INSTALL_DATA) Make.inc include/Make.inc.amg4psblas)
|
||||
|
||||
|
||||
amgp:
|
||||
amgobjs: mods
|
||||
cd amgprec && $(MAKE) objs
|
||||
cbnd: amgp
|
||||
|
||||
cbnd: mods
|
||||
cd cbind && $(MAKE) objs
|
||||
|
||||
install: lib
|
||||
install: all
|
||||
mkdir -p $(INSTALL_LIBDIR) &&\
|
||||
$(INSTALL_DATA) lib/*.a $(INSTALL_LIBDIR)
|
||||
mkdir -p $(INSTALL_INCLUDEDIR) &&\
|
||||
@@ -44,8 +45,10 @@ cleanlib:
|
||||
(cd include; /bin/rm -f *.a *$(.mod) *$(.fh))
|
||||
(cd modules; /bin/rm -f *.a *$(.mod) *$(.fh))
|
||||
|
||||
veryclean: cleanlib
|
||||
(cd amgprec && $(MAKE) veryclean)
|
||||
distclean: clean samplesclean
|
||||
/bin/rm -fr Make.inc amgprec/amg_config.h
|
||||
|
||||
samplesclean: clean
|
||||
(cd samples/simple/fileread && $(MAKE) clean)
|
||||
(cd samples/simple/pdegen && $(MAKE) clean)
|
||||
(cd samples/advanced/fileread && $(MAKE) clean)
|
||||
@@ -54,5 +57,6 @@ veryclean: cleanlib
|
||||
check: all
|
||||
make check -C samples/advanced/pdegen
|
||||
|
||||
clean:
|
||||
(cd amgprec && $(MAKE) clean)
|
||||
clean: cleanlib
|
||||
(cd amgprec && $(MAKE) veryclean)
|
||||
(cd cbind && $(MAKE) veryclean)
|
||||
|
||||
@@ -1,54 +1,166 @@
|
||||
AMG4PSBLAS
|
||||
Algebraic Multigrid Package based on PSBLAS (Parallel Sparse BLAS version 3.8)
|
||||
|
||||
Salvatore Filippone (University of Rome Tor Vergata and IAC-CNR)
|
||||
Pasqua D'Ambra (IAC-CNR, Naples, IT)
|
||||
Fabio Durastante (IAC-CNR, Naples, IT)
|
||||
# AMG4PSBLAS v1.2
|
||||
Algebraic Multigrid Package based on [PSBLAS](https://github.com/sfilippone/psblas3) (Parallel Sparse BLAS version 3.9)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
AMG4PSBLAS is a package of parallel algebraic multilevel preconditioners included in
|
||||
the PSCToolkit (Parallel Sparse Computation Toolkit) software framework.
|
||||
|
||||
AMG4PSBLAS is a package of Algebraic MultiGrid (AMG)
|
||||
preconditioners for the iterative solution of large and sparse linear systems.
|
||||
It is the prosecution of a software development project called MLD2P4 that started in 2007,
|
||||
which originally implemented a multilevel version of some domain decomposition preconditioners
|
||||
of additive-Schwarz type and was based on a parallel decoupled version of the well known
|
||||
smoothed aggregation method to generate the multilevel hierarchy of coarser matrices.
|
||||
|
||||
It is an evolution of MLD2P4 (see LICENSE.MLD2P4), but it has been
|
||||
thoroughly reworked, and it is sufficiently different to warrant a new
|
||||
project name.
|
||||
In the last few years the package was extended by including new algorithms and functionalities
|
||||
for the setup and application new AMG preconditioners with the final goal of improving efficiency
|
||||
and scalability when using tens of thousands cores and boosting reliability in dealing
|
||||
with general symmetric positive definite linear systems.
|
||||
|
||||
The original license is shown in the file [LICENSE.MLD2P4](LICENSE.MLD2P4); due to the
|
||||
significant number of changes and the vast enlargement in scope, we decided to rename
|
||||
the package as AMG4PSBLAS.
|
||||
|
||||
MAIN REFERENCES:
|
||||
AMG4PSBLAS has been designed to provide scalable and easy-to-use preconditioners in the context
|
||||
of the PSBLAS (Parallel Sparse Basic Linear Algebra Subprograms) computational framework and can be
|
||||
used in conjuction with the Krylov solvers available in this framework. Our package is based on
|
||||
a completely algebraic approach; therefore users level interfaces assume that the system matrix
|
||||
and preconditioners are represented as PSBLAS distributed sparse matrices.
|
||||
|
||||
|
||||
AMG4PSBLAS enables the user to easily specify different features of an algebraic multilevel preconditioner,
|
||||
thus allowing to experiment with different preconditioners for the problem and parallel computers at hand.
|
||||
|
||||
P. D'Ambra, D. di Serafino, S. Filippone,
|
||||
MLD2P4: a Package of Parallel Algebraic Multilevel Domain Decomposition
|
||||
Preconditioners in Fortran 95,
|
||||
ACM Transactions on Mathematical Software, 37 (3), 2010, art. 30,
|
||||
doi: 10.1145/1824801.1824808.
|
||||
The package employs object-oriented design techniques in Fortran 2008, with interfaces to additional third
|
||||
party libraries such as MUMPS, UMFPACK, SuperLU, and SuperLU_Dist, which can be exploited in building
|
||||
multilevel preconditioners. The parallel implementation is based on a Single Program Multiple Data (SPMD)
|
||||
paradigm; the inter-process communication is based on MPI and is managed mainly through PSBLAS.
|
||||
|
||||
## Main Refrerences:
|
||||
|
||||
TO COMPILE
|
||||
The main reference for this project is
|
||||
> D'Ambra, P., Durastante, F., & Filippone, S. (2021). AMG preconditioners for linear solvers towards extreme scale. SIAM Journal on Scientific Computing, 43(5), S679-S703.
|
||||
|
||||
AMG4PSBLAS is the suite of preconditioners for the Parallel Sparse Computation Toolkit ([PSCToolkit](https://psctoolkit.github.io/)) suite of libraries. See the paper:
|
||||
> D’Ambra, P., Durastante, F., & Filippone, S. (2023). Parallel Sparse Computation Toolkit. Software Impacts, 15, 100463.
|
||||
|
||||
The main reference for features inherited from MLD2P4 is
|
||||
> P. D'Ambra, D. di Serafino, S. Filippone,
|
||||
> MLD2P4: a Package of Parallel Algebraic Multilevel Domain Decomposition
|
||||
> Preconditioners in Fortran 95,
|
||||
> ACM Transactions on Mathematical Software, 37 (3), 2010, art. 30,
|
||||
> doi: 10.1145/1824801.1824808.
|
||||
|
||||
## Installing
|
||||
|
||||
Installation requires a working version of the [PSBLAS](https://github.com/sfilippone/psblas3) library
|
||||
as a prerequisite.
|
||||
AMG4PSBLAS has several interfaces to third-party libraries that can be used in the construction
|
||||
and application phases of preconditioners;
|
||||
in particular, it is possible to link AMG4PSBLAS with the libraries: MUMPS, SuperLU, SuperLU_Dist, UMFPACK.
|
||||
The usage of these third party libraries is _not mandatory_: the package can function
|
||||
in isolation and without these features.
|
||||
|
||||
0. Unpack the tar file in a directory of your choice (preferrably
|
||||
outside the main PSBLAS directory).
|
||||
1. run configure --with-psblas=<ABSOLUTE path of the PSBLAS install directory>
|
||||
1. run configure `--with-psblas=<ABSOLUTE path of the PSBLAS install directory> --prefix=<install_path>`
|
||||
adding the options for MUMPS, SuperLU, SuperLU_Dist, UMFPACK as desired.
|
||||
See MLD2P4 User's and Reference Guide (Section 3) for details.
|
||||
2. Tweak Make.inc if you are not satisfied.
|
||||
3. make;
|
||||
See [AMG4PSBLAS User's and Reference Guide](docs/amg4psblas_1.2-guide.pdf) (Section 3) for details.
|
||||
2. Tweak `Make.inc` if you are not satisfied.
|
||||
3. run `make`;
|
||||
4. Go into the test subdirectory and build the examples of your choice.
|
||||
5. (if desired): make install
|
||||
5. (if desired): `make install` or `sudo make install` if the install path requires privileged access.
|
||||
|
||||
>[!CAUTION]
|
||||
>The single precision version is supported only by MUMPS and SuperLU;
|
||||
>thus, even if you specify at configure time to use UMFPACK or SuperLU_Dist,
|
||||
>the corresponding preconditioner options will be available only from
|
||||
>the double precision version.
|
||||
|
||||
## CMAKE
|
||||
AMG4PSBLAS supports building with CMake. To configure the project, you must explicitly provide the path where PSBLAS is installed. If this path is not specified, the configuration will fail with a fatal error.
|
||||
|
||||
From the root directory of the project, run:
|
||||
### 1. Create and enter the build directory
|
||||
```
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
### 2. Configure the project (MANDATORY: specify your PSBLAS path)
|
||||
```
|
||||
cmake -DPSBLAS_INSTALL_DIR=</path/to/psblas/installation> ..
|
||||
```
|
||||
During this step, CMake will:
|
||||
- Search for the PSBLAS package in the provided path.
|
||||
- Detect and configure MPI (required for C, C++, and Fortran).
|
||||
- Set up include and module directories based on the PSBLAS configuration.
|
||||
- Configure integer sizes (IPK and LPK) to match the PSBLAS installation.
|
||||
### 2.1. Customizing the Installation Path
|
||||
By default, the library will be installed in standard system locations. To install amg4psblas in a custom directory, use the CMAKE_INSTALL_PREFIX variable:
|
||||
```
|
||||
cmake -DPSBLAS_INSTALL_DIR=</path/to/psblas/installation> \
|
||||
-DCMAKE_INSTALL_PREFIX=</path/to/amg4psblas_install> ..
|
||||
```
|
||||
|
||||
### 3. Compiling and Installing
|
||||
Once configured, you can build the libraries (amg_prec and amg_cbind) and install them.
|
||||
#### Build the library
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
#### Install the library, modules, and samples
|
||||
```
|
||||
make install
|
||||
```
|
||||
|
||||
|
||||
NOTES
|
||||
### CUDA, OpeMP, OpenACC
|
||||
|
||||
- The single precision version is supported only by MUMPS and SuperLU;
|
||||
thus, even if you specify at configure time to use UMFPACK or SuperLU_Dist,
|
||||
the corresponding preconditioner options will be available only from
|
||||
the double precision version.
|
||||
CUDA, OpenMP and OpenACC features are transparently inherited by PSBLAS installation.
|
||||
If PSBLAS has been configured (and installed) with these supports then AMG4PSBLAS will
|
||||
transparently inherit them. It will then be possible to move the computation to GPU accelerator
|
||||
simply by selecting the appropriate variable types in the application.
|
||||
If the types have not been activated or installed for PSBLAS then they will not be
|
||||
available for AMG4PSBLAS either and the operation will be purely on CPU/MPI. See also the samples/cuda folder.
|
||||
|
||||
### EoCoE - Software as service portal
|
||||
|
||||
The AMG4PSBLAS team.
|
||||
---------------
|
||||
Salvatore Filippone
|
||||
Pasqua D'Ambra
|
||||
Fabio Durastante
|
||||
In the European project “Energy oriented Center of Excellence: toward exascale for energy” we made
|
||||
available the software through a service portal: [https://eocoe.psnc.pl/](https://eocoe.psnc.pl/).
|
||||
This permits to test several cutting-edge computational methods for accelerating the transition
|
||||
to production, storage and management of clean, decarbonized energy.
|
||||
Among them you have the possibility of running PSBLAS+AMG4PSBLAS on some test problems
|
||||
to become familiar with using the software.
|
||||
## MPI and Compilers
|
||||
The library has been successfully compiled and tested with the same compilers
|
||||
and MPI implementations as PSBLAS 3.9, which include:
|
||||
- MPICH 4.2.3, 4.3.0, 4.3.2
|
||||
- OpenMPI 4.1.8. 5.0.7, 5.0.8, 5.0.9
|
||||
|
||||
combined with
|
||||
|
||||
- GNU compilers 10.5.0, 11.5.0, 12.5.0, 13.3.0, 14.2.0 14.3.0, 15.2.0
|
||||
- LLVM 20.1.0 and 21.1.0 (except OpenMPI 4.1.8 which does not build with LLVM)
|
||||
|
||||
Moreover, it has been tested with the Intel OneAPI toolchain versions 2025.2 and 2025.3
|
||||
|
||||
As of this release, the NVIDIA compiler 25.7 fails to handle our code.
|
||||
Cray, IBM and NAg compilers have been used for testing in the past, but not on this version.
|
||||
|
||||
## TODO and bugs
|
||||
|
||||
- [X] Fix all reamining bugs. Bugs? We dont' have any ! 🤓
|
||||
|
||||
> [!NOTE]
|
||||
> To report bugs 🐛 or issues ❓ please use the [GitHub issue system](https://github.com/sfilippone/amg4psblas/issues).
|
||||
|
||||
## The AMG4PSBLAS team.
|
||||
|
||||
- Pasqua D'Ambra (IAC-CNR, Naples, IT)
|
||||
- Fabio Durastante (University of Pisa and IAC-CNR, IT)
|
||||
- Salvatore Filippone (University of Rome Tor Vergata and IAC-CNR, IT)
|
||||
|
||||
**Contributors** (_roughly reverse cronological order_):
|
||||
|
||||
- Luca Pepè Sciarria
|
||||
- Andrea Di Iorio
|
||||
- Ambra Abdullahi Hassan
|
||||
- Alfredo Buttari
|
||||
|
||||
+14
@@ -1,5 +1,19 @@
|
||||
WHAT'S NEW
|
||||
|
||||
AMG4PSBLAS
|
||||
Version 1.2
|
||||
1. New polynomial smoothers.
|
||||
2. Introduced L1-variants
|
||||
3. Reorganization of sample programs.
|
||||
|
||||
Version 1.1
|
||||
1. Reworked approximate inverse solvers.
|
||||
|
||||
|
||||
Version 1.0
|
||||
1. Transitioned from MLD2P4
|
||||
|
||||
MLD2P4
|
||||
Version 2.1
|
||||
1. The multigrid preconditioner now include fully general V- and
|
||||
W-cycles. We also support K-cycles, both for symmetric and
|
||||
|
||||
@@ -0,0 +1,907 @@
|
||||
set(AMG_amgprec_source_files
|
||||
amg_s_ainv_solver.F90
|
||||
amg_d_ainv_solver.F90
|
||||
amg_z_base_solver_mod.f90
|
||||
amg_z_slu_solver.F90
|
||||
amg_z_gs_solver.f90
|
||||
amg_d_ilu_fact_mod.f90
|
||||
# amg_z_hybrid_aggregator_mod.F90
|
||||
amg_c_base_smoother_mod.f90
|
||||
amg_s_matchboxp_mod.F90
|
||||
amg_c_gs_solver.f90
|
||||
amg_z_prec_type.f90
|
||||
amg_s_base_solver_mod.f90
|
||||
amg_d_slu_solver.F90
|
||||
amg_z_inner_mod.f90
|
||||
amg_d_base_aggregator_mod.f90
|
||||
amg_c_diag_solver.f90
|
||||
amg_z_krm_solver.f90
|
||||
impl/amg_zfile_prec_descr.f90
|
||||
impl/amg_c_hierarchy_rebld.f90
|
||||
impl/amg_dcprecset.F90
|
||||
impl/amg_sprecinit.F90
|
||||
impl/amg_cprecinit.F90
|
||||
impl/amg_smlprec_aply.f90
|
||||
impl/level/amg_s_base_onelev_map_rstr.F90
|
||||
impl/level/amg_c_base_onelev_csetr.f90
|
||||
impl/level/amg_d_base_onelev_map_rstr.F90
|
||||
impl/level/amg_z_base_onelev_setsv.F90
|
||||
impl/level/amg_d_base_onelev_descr.f90
|
||||
impl/level/amg_d_base_onelev_setag.f90
|
||||
impl/level/amg_s_base_onelev_dump.f90
|
||||
impl/level/amg_s_base_onelev_build.f90
|
||||
impl/level/amg_c_base_onelev_map_rstr.F90
|
||||
impl/level/amg_z_base_onelev_memory_use.f90
|
||||
impl/level/amg_s_base_onelev_map_prol.F90
|
||||
impl/level/amg_d_base_onelev_csetc.F90
|
||||
impl/level/amg_d_base_onelev_cnv.f90
|
||||
impl/level/amg_c_base_onelev_setsv.F90
|
||||
impl/level/amg_c_base_onelev_descr.f90
|
||||
impl/level/amg_z_base_onelev_setsm.F90
|
||||
impl/level/amg_d_base_onelev_csetr.f90
|
||||
impl/level/amg_s_base_onelev_descr.f90
|
||||
impl/level/amg_c_base_onelev_build.f90
|
||||
impl/level/amg_c_base_onelev_setag.f90
|
||||
impl/level/amg_c_base_onelev_free_smoothers.f90
|
||||
impl/level/amg_c_base_onelev_memory_use.f90
|
||||
impl/level/amg_s_base_onelev_csetr.f90
|
||||
impl/level/amg_s_base_onelev_mat_asb.f90
|
||||
impl/level/amg_c_base_onelev_free.f90
|
||||
impl/level/amg_d_base_onelev_free_smoothers.f90
|
||||
impl/level/amg_z_base_onelev_map_prol.F90
|
||||
impl/level/amg_s_base_onelev_free_smoothers.f90
|
||||
impl/level/amg_d_base_onelev_map_prol.F90
|
||||
impl/level/amg_d_base_onelev_free.f90
|
||||
impl/level/amg_z_base_onelev_cnv.f90
|
||||
impl/level/amg_s_base_onelev_cseti.F90
|
||||
impl/level/amg_s_base_onelev_csetc.F90
|
||||
impl/level/amg_c_base_onelev_map_prol.F90
|
||||
impl/level/amg_d_base_onelev_check.f90
|
||||
impl/level/amg_d_base_onelev_setsm.F90
|
||||
impl/level/amg_s_base_onelev_setsv.F90
|
||||
impl/level/amg_z_base_onelev_mat_asb.f90
|
||||
impl/level/amg_c_base_onelev_mat_asb.f90
|
||||
impl/level/amg_z_base_onelev_cseti.F90
|
||||
impl/level/amg_z_base_onelev_descr.f90
|
||||
impl/level/amg_z_base_onelev_map_rstr.F90
|
||||
impl/level/amg_z_base_onelev_check.f90
|
||||
impl/level/amg_c_base_onelev_cnv.f90
|
||||
impl/level/amg_z_base_onelev_build.f90
|
||||
impl/level/amg_d_base_onelev_build.f90
|
||||
impl/level/amg_c_base_onelev_cseti.F90
|
||||
impl/level/amg_c_base_onelev_check.f90
|
||||
impl/level/amg_s_base_onelev_check.f90
|
||||
impl/level/amg_s_base_onelev_memory_use.f90
|
||||
impl/level/amg_s_base_onelev_cnv.f90
|
||||
impl/level/amg_z_base_onelev_setag.f90
|
||||
impl/level/amg_s_base_onelev_free.f90
|
||||
impl/level/amg_z_base_onelev_dump.f90
|
||||
impl/level/amg_z_base_onelev_csetr.f90
|
||||
impl/level/amg_z_base_onelev_free_smoothers.f90
|
||||
impl/level/amg_c_base_onelev_csetc.F90
|
||||
impl/level/amg_d_base_onelev_dump.f90
|
||||
impl/level/amg_z_base_onelev_csetc.F90
|
||||
impl/level/amg_d_base_onelev_setsv.F90
|
||||
impl/level/amg_s_base_onelev_setsm.F90
|
||||
impl/level/amg_d_base_onelev_mat_asb.f90
|
||||
impl/level/amg_s_base_onelev_setag.f90
|
||||
impl/level/amg_d_base_onelev_cseti.F90
|
||||
impl/level/amg_d_base_onelev_memory_use.f90
|
||||
impl/level/amg_c_base_onelev_setsm.F90
|
||||
impl/level/amg_z_base_onelev_free.f90
|
||||
impl/level/amg_c_base_onelev_dump.f90
|
||||
impl/amg_z_hierarchy_bld.F90
|
||||
impl/amg_zfile_prec_memory_use.f90
|
||||
impl/amg_c_smoothers_bld.f90
|
||||
impl/amg_dmlprec_aply.f90
|
||||
impl/amg_cprecaply.f90
|
||||
impl/amg_zcprecset.F90
|
||||
impl/amg_z_smoothers_bld.f90
|
||||
impl/amg_cprecset.F90
|
||||
impl/amg_cfile_prec_memory_use.f90
|
||||
impl/amg_z_extprol_bld.F90
|
||||
impl/amg_sprecbld.f90
|
||||
impl/amg_s_hierarchy_rebld.f90
|
||||
impl/amg_s_smoothers_bld.f90
|
||||
impl/amg_dprecinit.F90
|
||||
impl/amg_zmlprec_bld.f90
|
||||
impl/amg_smlprec_bld.f90
|
||||
impl/amg_sfile_prec_memory_use.f90
|
||||
impl/amg_dprecaply.f90
|
||||
impl/amg_zprecbld.f90
|
||||
impl/amg_z_hierarchy_rebld.f90
|
||||
impl/amg_c_extprol_bld.F90
|
||||
impl/amg_zprecaply.f90
|
||||
impl/amg_s_extprol_bld.F90
|
||||
impl/amg_dfile_prec_memory_use.f90
|
||||
impl/solver/amg_z_invt_solver_clone_settings.f90
|
||||
impl/solver/amg_c_gs_solver_clear_data.f90
|
||||
impl/solver/amg_d_base_solver_apply.f90
|
||||
impl/solver/amg_s_ilu_solver_apply.f90
|
||||
impl/solver/amg_d_jac_solver_apply.f90
|
||||
impl/solver/amg_z_base_solver_csetr.f90
|
||||
impl/solver/amg_z_ilu_solver_dmp.f90
|
||||
impl/solver/amg_d_diag_solver_dmp.f90
|
||||
impl/solver/amg_c_invt_solver_check.f90
|
||||
impl/solver/amg_z_base_solver_descr.f90
|
||||
impl/solver/amg_d_mumps_solver_apply_vect.F90
|
||||
impl/solver/amg_d_l1_jac_solver_bld.f90
|
||||
impl/solver/amg_z_base_solver_cseti.f90
|
||||
impl/solver/amg_d_ainv_solver_check.f90
|
||||
impl/solver/amg_s_invt_solver_bld.f90
|
||||
impl/solver/amg_z_ainv_solver_clone_settings.f90
|
||||
impl/solver/amg_c_bwgs_solver_bld.f90
|
||||
impl/solver/amg_z_base_ainv_solver_apply_vect.f90
|
||||
impl/solver/amg_d_id_solver_apply.f90
|
||||
impl/solver/amg_s_base_solver_apply_vect.f90
|
||||
impl/solver/amg_s_base_solver_clone.f90
|
||||
impl/solver/amg_c_base_ainv_update_a.f90
|
||||
impl/solver/amg_s_id_solver_clone.f90
|
||||
impl/solver/amg_s_invk_solver_clone_settings.f90
|
||||
impl/solver/amg_z_ainv_solver_bld.f90
|
||||
impl/solver/amg_z_diag_solver_cnv.f90
|
||||
impl/solver/amg_d_mumps_solver_bld.F90
|
||||
impl/solver/amg_d_jac_solver_clear_data.f90
|
||||
impl/solver/amg_c_jac_solver_clone_settings.f90
|
||||
impl/solver/amg_z_gs_solver_clear_data.f90
|
||||
impl/solver/amg_c_ainv_solver_cseti.f90
|
||||
impl/solver/amg_z_base_solver_cnv.f90
|
||||
impl/solver/amg_s_bwgs_solver_bld.f90
|
||||
impl/solver/amg_s_id_solver_apply_vect.f90
|
||||
impl/solver/amg_z_jac_solver_clone.f90
|
||||
impl/solver/amg_z_ainv_solver_check.f90
|
||||
impl/solver/amg_d_ilu_solver_clear_data.f90
|
||||
impl/solver/amg_s_invk_solver_cseti.f90
|
||||
impl/solver/amg_s_ainv_solver_csetc.f90
|
||||
impl/solver/amg_z_base_ainv_solver_apply.f90
|
||||
impl/solver/amg_c_gs_solver_clone.f90
|
||||
impl/solver/amg_d_base_ainv_solver_apply.f90
|
||||
# impl/solver/amg_d_ainv_solver_setr.f90
|
||||
impl/solver/amg_d_invt_solver_clone.f90
|
||||
impl/solver/amg_d_gs_solver_apply_vect.f90
|
||||
impl/solver/amg_s_base_solver_dmp.f90
|
||||
impl/solver/amg_d_ainv_solver_descr.f90
|
||||
impl/solver/amg_d_jac_solver_clone_settings.f90
|
||||
impl/solver/amg_z_base_solver_check.f90
|
||||
impl/solver/amg_z_diag_solver_clone.f90
|
||||
impl/solver/amg_s_invk_solver_clone.f90
|
||||
# impl/solver/amg_d_ainv_solver_setc.f90
|
||||
impl/solver/amg_d_gs_solver_clear_data.f90
|
||||
impl/solver/amg_c_invt_solver_bld.f90
|
||||
impl/solver/amg_s_jac_solver_clear_data.f90
|
||||
impl/solver/amg_d_jac_solver_dmp.f90
|
||||
|
||||
impl/solver/amg_c_base_solver_dmp.f90
|
||||
impl/solver/amg_s_diag_solver_dmp.f90
|
||||
impl/solver/amg_d_invt_solver_check.f90
|
||||
impl/solver/amg_c_ilu_solver_clear_data.f90
|
||||
impl/solver/amg_z_invt_solver_descr.f90
|
||||
impl/solver/amg_d_diag_solver_clone.f90
|
||||
impl/solver/amg_s_jac_solver_bld.f90
|
||||
impl/solver/amg_s_mumps_solver_apply.F90
|
||||
impl/solver/amg_z_jac_solver_clone_settings.f90
|
||||
# impl/solver/amg_d_invt_solver_seti.f90
|
||||
impl/solver/amg_s_base_ainv_solver_apply_vect.f90
|
||||
impl/solver/amg_z_diag_solver_apply.f90
|
||||
impl/solver/amg_s_base_solver_free.f90
|
||||
impl/solver/amg_d_ainv_solver_clone.f90
|
||||
impl/solver/amg_s_krm_solver_impl.f90
|
||||
# impl/solver/amg_d_ainv_solver_seti.f90
|
||||
impl/solver/amg_z_ainv_solver_clone.f90
|
||||
impl/solver/amg_d_base_ainv_solver_free.f90
|
||||
# impl/solver/amg_c_invk_solver_seti.f90
|
||||
impl/solver/amg_s_ilu_solver_dmp.f90
|
||||
impl/solver/amg_z_base_solver_apply.f90
|
||||
impl/solver/amg_d_ilu_solver_apply_vect.f90
|
||||
impl/solver/amg_z_jac_solver_dmp.f90
|
||||
impl/solver/amg_c_base_ainv_solver_cnv.f90
|
||||
impl/solver/amg_s_gs_solver_cnv.f90
|
||||
impl/solver/amg_s_id_solver_apply.f90
|
||||
impl/solver/amg_d_jac_solver_apply_vect.f90
|
||||
impl/solver/amg_s_base_solver_bld.f90
|
||||
impl/solver/amg_z_base_solver_csetc.f90
|
||||
impl/solver/amg_d_gs_solver_cnv.f90
|
||||
impl/solver/amg_d_bwgs_solver_apply.f90
|
||||
impl/solver/amg_c_diag_solver_dmp.f90
|
||||
impl/solver/amg_d_ilu_solver_dmp.f90
|
||||
impl/solver/amg_s_base_solver_check.f90
|
||||
impl/solver/amg_c_invk_solver_clone.f90
|
||||
impl/solver/amg_d_invk_solver_check.f90
|
||||
impl/solver/amg_z_ilu_solver_clone.f90
|
||||
impl/solver/amg_d_base_solver_cseti.f90
|
||||
impl/solver/amg_c_base_solver_bld.f90
|
||||
impl/solver/amg_z_jac_solver_apply_vect.f90
|
||||
impl/solver/amg_z_id_solver_apply.f90
|
||||
impl/solver/amg_d_base_solver_bld.f90
|
||||
# impl/solver/amg_s_ainv_solver_seti.f90
|
||||
impl/solver/amg_z_jac_solver_bld.f90
|
||||
impl/solver/amg_z_base_solver_apply_vect.f90
|
||||
impl/solver/amg_d_base_solver_clone.f90
|
||||
impl/solver/amg_d_ainv_solver_csetr.f90
|
||||
impl/solver/amg_s_invt_solver_cseti.f90
|
||||
impl/solver/amg_c_id_solver_apply_vect.f90
|
||||
impl/solver/amg_s_mumps_solver_apply_vect.F90
|
||||
impl/solver/amg_z_ilu_solver_apply.f90
|
||||
impl/solver/amg_c_diag_solver_apply_vect.f90
|
||||
impl/solver/amg_s_gs_solver_dmp.f90
|
||||
impl/solver/amg_z_base_ainv_solver_dmp.f90
|
||||
impl/solver/amg_c_diag_solver_cnv.f90
|
||||
# impl/solver/amg_z_invt_solver_setr.f90
|
||||
impl/solver/amg_z_diag_solver_apply_vect.f90
|
||||
impl/solver/amg_d_ainv_solver_cseti.f90
|
||||
impl/solver/amg_z_ilu_solver_clear_data.f90
|
||||
impl/solver/amg_d_base_solver_csetc.f90
|
||||
impl/solver/amg_c_invk_solver_descr.f90
|
||||
impl/solver/amg_d_invt_solver_csetr.f90
|
||||
impl/solver/amg_d_invt_solver_cseti.f90
|
||||
impl/solver/amg_z_invk_solver_bld.f90
|
||||
impl/solver/amg_s_jac_solver_clone.f90
|
||||
impl/solver/amg_d_bwgs_solver_bld.f90
|
||||
impl/solver/amg_z_diag_solver_bld.f90
|
||||
impl/solver/amg_s_l1_jac_solver_bld.f90
|
||||
impl/solver/amg_s_invt_solver_descr.f90
|
||||
impl/solver/amg_s_ilu_solver_bld.f90
|
||||
impl/solver/amg_c_gs_solver_clone_settings.f90
|
||||
impl/solver/amg_c_jac_solver_bld.f90
|
||||
impl/solver/amg_d_gs_solver_clone_settings.f90
|
||||
impl/solver/amg_d_base_solver_descr.f90
|
||||
impl/solver/amg_d_base_solver_dmp.f90
|
||||
impl/solver/amg_c_ainv_solver_bld.f90
|
||||
impl/solver/amg_s_invt_solver_check.f90
|
||||
impl/solver/amg_z_gs_solver_apply_vect.f90
|
||||
impl/solver/amg_z_ainv_solver_descr.f90
|
||||
# impl/solver/amg_c_invt_solver_seti.f90
|
||||
impl/solver/amg_c_base_solver_apply.f90
|
||||
impl/solver/amg_z_gs_solver_dmp.f90
|
||||
impl/solver/amg_d_ainv_solver_clone_settings.f90
|
||||
impl/solver/amg_c_id_solver_apply.f90
|
||||
impl/solver/amg_z_base_solver_clone.f90
|
||||
impl/solver/amg_s_invk_solver_check.f90
|
||||
impl/solver/amg_c_gs_solver_bld.f90
|
||||
impl/solver/amg_s_ilu_solver_cnv.f90
|
||||
impl/solver/amg_z_ainv_solver_csetc.f90
|
||||
impl/solver/amg_s_ainv_solver_clone_settings.f90
|
||||
impl/solver/amg_c_base_ainv_solver_apply_vect.f90
|
||||
impl/solver/amg_s_diag_solver_apply.f90
|
||||
impl/solver/amg_s_base_ainv_update_a.f90
|
||||
impl/solver/amg_c_base_solver_csetc.f90
|
||||
impl/solver/amg_c_jac_solver_clone.f90
|
||||
impl/solver/amg_c_base_solver_descr.f90
|
||||
impl/solver/amg_c_invt_solver_clone.f90
|
||||
impl/solver/amg_c_ilu_solver_bld.f90
|
||||
impl/solver/amg_d_base_ainv_solver_apply_vect.f90
|
||||
impl/solver/amg_d_base_solver_apply_vect.f90
|
||||
impl/solver/amg_z_invt_solver_check.f90
|
||||
impl/solver/amg_c_base_solver_cseti.f90
|
||||
impl/solver/amg_s_jac_solver_dmp.f90
|
||||
# impl/solver/amg_s_invk_solver_seti.f90
|
||||
impl/solver/amg_s_ainv_solver_check.f90
|
||||
impl/solver/amg_d_base_solver_clear_data.f90
|
||||
impl/solver/amg_z_gs_solver_clone_settings.f90
|
||||
impl/solver/amg_c_invk_solver_check.f90
|
||||
impl/solver/amg_s_base_solver_cseti.f90
|
||||
impl/solver/amg_z_base_ainv_solver_free.f90
|
||||
impl/solver/amg_z_invk_solver_clone_settings.f90
|
||||
impl/solver/amg_c_base_ainv_solver_dmp.f90
|
||||
impl/solver/amg_s_gs_solver_clear_data.f90
|
||||
impl/solver/amg_s_base_ainv_solver_apply.f90
|
||||
impl/solver/amg_c_base_solver_apply_vect.f90
|
||||
impl/solver/amg_d_diag_solver_cnv.f90
|
||||
impl/solver/amg_d_id_solver_apply_vect.f90
|
||||
impl/solver/amg_z_base_solver_bld.f90
|
||||
impl/solver/amg_z_base_solver_dmp.f90
|
||||
impl/solver/amg_d_invt_solver_clone_settings.f90
|
||||
impl/solver/amg_c_diag_solver_clone.f90
|
||||
impl/solver/amg_z_gs_solver_apply.f90
|
||||
impl/solver/amg_c_invt_solver_clone_settings.f90
|
||||
impl/solver/amg_z_base_solver_free.f90
|
||||
impl/solver/amg_d_diag_solver_clear_data.f90
|
||||
impl/solver/amg_d_ilu_solver_clone_settings.f90
|
||||
# impl/solver/amg_z_invt_solver_seti.f90
|
||||
# impl/solver/amg_z_ainv_solver_seti.f90
|
||||
impl/solver/amg_c_diag_solver_apply.f90
|
||||
impl/solver/amg_d_base_ainv_solver_dmp.f90
|
||||
impl/solver/amg_c_invt_solver_csetr.f90
|
||||
# impl/solver/amg_c_invt_solver_setr.f90
|
||||
impl/solver/amg_c_jac_solver_clear_data.f90
|
||||
impl/solver/amg_c_invk_solver_bld.f90
|
||||
impl/solver/amg_c_ainv_solver_csetc.f90
|
||||
impl/solver/amg_s_ainv_solver_cseti.f90
|
||||
impl/solver/amg_z_base_solver_clear_data.f90
|
||||
impl/solver/amg_z_invk_solver_check.f90
|
||||
impl/solver/amg_c_diag_solver_bld.f90
|
||||
impl/solver/amg_d_invk_solver_clone_settings.f90
|
||||
impl/solver/amg_s_ainv_solver_clone.f90
|
||||
impl/solver/amg_s_diag_solver_clear_data.f90
|
||||
impl/solver/amg_d_gs_solver_clone.f90
|
||||
impl/solver/amg_s_base_solver_csetr.f90
|
||||
impl/solver/amg_c_ilu_solver_dmp.f90
|
||||
impl/solver/amg_c_base_solver_cnv.f90
|
||||
# impl/solver/amg_z_ainv_solver_setc.f90
|
||||
impl/solver/amg_z_jac_solver_apply.f90
|
||||
impl/solver/amg_s_ainv_solver_descr.f90
|
||||
impl/solver/amg_z_base_ainv_solver_cnv.f90
|
||||
impl/solver/amg_c_ilu_solver_apply.f90
|
||||
impl/solver/amg_c_ilu_solver_cnv.f90
|
||||
impl/solver/amg_z_bwgs_solver_bld.f90
|
||||
impl/solver/amg_c_base_ainv_solver_free.f90
|
||||
impl/solver/amg_s_base_solver_clone_settings.f90
|
||||
impl/solver/amg_z_invt_solver_bld.f90
|
||||
impl/solver/amg_s_base_ainv_solver_free.f90
|
||||
impl/solver/amg_s_base_solver_clear_data.f90
|
||||
impl/solver/amg_s_invt_solver_csetr.f90
|
||||
impl/solver/amg_d_diag_solver_apply_vect.f90
|
||||
impl/solver/amg_s_diag_solver_bld.f90
|
||||
impl/solver/amg_s_diag_solver_cnv.f90
|
||||
impl/solver/amg_d_diag_solver_apply.f90
|
||||
impl/solver/amg_d_invk_solver_descr.f90
|
||||
impl/solver/amg_z_mumps_solver_apply.F90
|
||||
impl/solver/amg_s_base_solver_descr.f90
|
||||
impl/solver/amg_c_jac_solver_apply_vect.f90
|
||||
impl/solver/amg_s_base_ainv_solver_dmp.f90
|
||||
impl/solver/amg_z_krm_solver_impl.f90
|
||||
impl/solver/amg_z_invt_solver_csetr.f90
|
||||
impl/solver/amg_c_ainv_solver_check.f90
|
||||
# impl/solver/amg_s_invt_solver_seti.f90
|
||||
impl/solver/amg_z_ainv_solver_cseti.f90
|
||||
impl/solver/amg_z_invk_solver_clone.f90
|
||||
impl/solver/amg_s_base_solver_csetc.f90
|
||||
impl/solver/amg_z_bwgs_solver_apply_vect.f90
|
||||
impl/solver/amg_c_bwgs_solver_apply.f90
|
||||
impl/solver/amg_c_base_solver_csetr.f90
|
||||
impl/solver/amg_c_invk_solver_cseti.f90
|
||||
impl/solver/amg_d_krm_solver_impl.f90
|
||||
impl/solver/amg_s_invk_solver_bld.f90
|
||||
impl/solver/amg_c_mumps_solver_apply.F90
|
||||
impl/solver/amg_z_jac_solver_cnv.f90
|
||||
# impl/solver/amg_s_ainv_solver_setr.f90
|
||||
impl/solver/amg_d_gs_solver_bld.f90
|
||||
impl/solver/amg_c_ilu_solver_clone_settings.f90
|
||||
impl/solver/amg_z_base_solver_clone_settings.f90
|
||||
impl/solver/amg_d_ilu_solver_clone.f90
|
||||
impl/solver/amg_c_ilu_solver_clone.f90
|
||||
impl/solver/amg_d_ainv_solver_bld.f90
|
||||
impl/solver/amg_c_gs_solver_apply.f90
|
||||
impl/solver/amg_z_mumps_solver_apply_vect.F90
|
||||
impl/solver/amg_c_ainv_solver_clone.f90
|
||||
impl/solver/amg_c_base_solver_clear_data.f90
|
||||
impl/solver/amg_z_diag_solver_dmp.f90
|
||||
impl/solver/amg_z_id_solver_apply_vect.f90
|
||||
impl/solver/amg_d_ilu_solver_bld.f90
|
||||
impl/solver/amg_s_base_solver_apply.f90
|
||||
impl/solver/amg_s_ainv_solver_csetr.f90
|
||||
impl/solver/amg_z_ilu_solver_cnv.f90
|
||||
impl/solver/amg_s_invk_solver_descr.f90
|
||||
impl/solver/amg_d_jac_solver_bld.f90
|
||||
impl/solver/amg_z_invk_solver_cseti.f90
|
||||
impl/solver/amg_z_id_solver_clone.f90
|
||||
impl/solver/amg_d_id_solver_clone.f90
|
||||
impl/solver/amg_z_diag_solver_clear_data.f90
|
||||
impl/solver/amg_s_gs_solver_bld.f90
|
||||
impl/solver/amg_s_bwgs_solver_apply.f90
|
||||
impl/solver/amg_s_gs_solver_clone.f90
|
||||
impl/solver/amg_s_jac_solver_apply.f90
|
||||
impl/solver/amg_z_ilu_solver_clone_settings.f90
|
||||
impl/solver/amg_c_mumps_solver_bld.F90
|
||||
impl/solver/amg_d_mumps_solver_apply.F90
|
||||
# impl/solver/amg_s_ainv_solver_setc.f90
|
||||
impl/solver/amg_d_base_solver_cnv.f90
|
||||
impl/solver/amg_s_ilu_solver_clear_data.f90
|
||||
impl/solver/amg_d_bwgs_solver_apply_vect.f90
|
||||
impl/solver/amg_s_jac_solver_apply_vect.f90
|
||||
impl/solver/amg_c_invk_solver_clone_settings.f90
|
||||
impl/solver/amg_c_base_solver_clone_settings.f90
|
||||
impl/solver/amg_z_gs_solver_cnv.f90
|
||||
impl/solver/amg_s_invt_solver_clone.f90
|
||||
# impl/solver/amg_z_invk_solver_seti.f90
|
||||
impl/solver/amg_c_ainv_solver_csetr.f90
|
||||
impl/solver/amg_c_jac_solver_apply.f90
|
||||
impl/solver/amg_c_gs_solver_dmp.f90
|
||||
impl/solver/amg_z_ilu_solver_bld.f90
|
||||
impl/solver/amg_c_invt_solver_descr.f90
|
||||
impl/solver/amg_z_invt_solver_clone.f90
|
||||
impl/solver/amg_d_base_ainv_update_a.f90
|
||||
impl/solver/amg_c_base_solver_clone.f90
|
||||
impl/solver/amg_s_diag_solver_clone.f90
|
||||
impl/solver/amg_d_invt_solver_bld.f90
|
||||
# impl/solver/amg_c_ainv_solver_setc.f90
|
||||
impl/solver/amg_d_gs_solver_dmp.f90
|
||||
impl/solver/amg_s_gs_solver_apply.f90
|
||||
impl/solver/amg_d_jac_solver_clone.f90
|
||||
impl/solver/amg_z_jac_solver_clear_data.f90
|
||||
impl/solver/amg_c_invt_solver_cseti.f90
|
||||
impl/solver/amg_d_ilu_solver_apply.f90
|
||||
# impl/solver/amg_c_ainv_solver_setr.f90
|
||||
impl/solver/amg_c_gs_solver_cnv.f90
|
||||
impl/solver/amg_c_diag_solver_clear_data.f90
|
||||
impl/solver/amg_c_base_solver_check.f90
|
||||
impl/solver/amg_c_base_solver_free.f90
|
||||
impl/solver/amg_z_invt_solver_cseti.f90
|
||||
impl/solver/amg_d_base_solver_check.f90
|
||||
impl/solver/amg_d_invk_solver_clone.f90
|
||||
impl/solver/amg_c_krm_solver_impl.f90
|
||||
impl/solver/amg_d_base_ainv_solver_cnv.f90
|
||||
impl/solver/amg_d_invk_solver_cseti.f90
|
||||
impl/solver/amg_z_mumps_solver_bld.F90
|
||||
impl/solver/amg_z_gs_solver_bld.f90
|
||||
# impl/solver/amg_z_ainv_solver_setr.f90
|
||||
impl/solver/amg_s_gs_solver_apply_vect.f90
|
||||
impl/solver/amg_s_jac_solver_clone_settings.f90
|
||||
impl/solver/amg_z_gs_solver_clone.f90
|
||||
impl/solver/amg_c_gs_solver_apply_vect.f90
|
||||
impl/solver/amg_d_base_solver_csetr.f90
|
||||
impl/solver/amg_s_ainv_solver_bld.f90
|
||||
impl/solver/amg_z_l1_jac_solver_bld.f90
|
||||
impl/solver/amg_z_base_ainv_update_a.f90
|
||||
impl/solver/amg_z_ainv_solver_csetr.f90
|
||||
impl/solver/amg_s_ilu_solver_apply_vect.f90
|
||||
# impl/solver/amg_s_invt_solver_setr.f90
|
||||
# impl/solver/amg_d_invt_solver_setr.f90
|
||||
impl/solver/amg_d_invk_solver_bld.f90
|
||||
impl/solver/amg_s_jac_solver_cnv.f90
|
||||
impl/solver/amg_z_bwgs_solver_apply.f90
|
||||
impl/solver/amg_s_bwgs_solver_apply_vect.f90
|
||||
# impl/solver/amg_d_invk_solver_seti.f90
|
||||
impl/solver/amg_d_ilu_solver_cnv.f90
|
||||
impl/solver/amg_s_mumps_solver_bld.F90
|
||||
impl/solver/amg_s_gs_solver_clone_settings.f90
|
||||
impl/solver/amg_c_jac_solver_dmp.f90
|
||||
impl/solver/amg_d_jac_solver_cnv.f90
|
||||
impl/solver/amg_c_ilu_solver_apply_vect.f90
|
||||
impl/solver/amg_c_mumps_solver_apply_vect.F90
|
||||
impl/solver/amg_z_ilu_solver_apply_vect.f90
|
||||
impl/solver/amg_s_ilu_solver_clone_settings.f90
|
||||
impl/solver/amg_c_ainv_solver_clone_settings.f90
|
||||
# impl/solver/amg_c_ainv_solver_seti.f90
|
||||
impl/solver/amg_s_ilu_solver_clone.f90
|
||||
impl/solver/amg_d_diag_solver_bld.f90
|
||||
impl/solver/amg_c_l1_jac_solver_bld.f90
|
||||
impl/solver/amg_c_bwgs_solver_apply_vect.f90
|
||||
impl/solver/amg_c_jac_solver_cnv.f90
|
||||
impl/solver/amg_c_id_solver_clone.f90
|
||||
impl/solver/amg_d_gs_solver_apply.f90
|
||||
impl/solver/amg_z_invk_solver_descr.f90
|
||||
impl/solver/amg_s_diag_solver_apply_vect.f90
|
||||
impl/solver/amg_s_base_solver_cnv.f90
|
||||
impl/solver/amg_d_base_solver_clone_settings.f90
|
||||
impl/solver/amg_s_invt_solver_clone_settings.f90
|
||||
impl/solver/amg_d_ainv_solver_csetc.f90
|
||||
impl/solver/amg_d_invt_solver_descr.f90
|
||||
impl/solver/amg_d_base_solver_free.f90
|
||||
impl/solver/amg_c_base_ainv_solver_apply.f90
|
||||
impl/solver/amg_s_base_ainv_solver_cnv.f90
|
||||
impl/solver/amg_c_ainv_solver_descr.f90
|
||||
impl/amg_sfile_prec_descr.f90
|
||||
impl/amg_zprecinit.F90
|
||||
impl/amg_dprecbld.f90
|
||||
impl/amg_sprecaply.f90
|
||||
impl/amg_cprecbld.f90
|
||||
impl/amg_cfile_prec_descr.f90
|
||||
impl/amg_s_hierarchy_bld.F90
|
||||
impl/amg_dfile_prec_descr.f90
|
||||
impl/amg_ccprecset.F90
|
||||
impl/amg_d_hierarchy_bld.F90
|
||||
impl/amg_c_hierarchy_bld.F90
|
||||
impl/smoother/amg_d_base_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_as_smoother_check.f90
|
||||
impl/smoother/amg_c_l1_jac_smoother_clone.f90
|
||||
impl/smoother/amg_z_l1_jac_smoother_bld.f90
|
||||
impl/smoother/amg_s_poly_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_poly_smoother_apply_vect.f90
|
||||
impl/smoother/amg_z_jac_smoother_clone_settings.f90
|
||||
impl/smoother/amg_s_poly_smoother_csetc.f90
|
||||
impl/smoother/amg_s_as_smoother_prol_a.f90
|
||||
impl/smoother/amg_s_base_smoother_csetc.f90
|
||||
impl/smoother/amg_s_as_smoother_apply.f90
|
||||
impl/smoother/amg_z_base_smoother_csetr.f90
|
||||
impl/smoother/amg_c_jac_smoother_apply.f90
|
||||
impl/smoother/amg_s_base_smoother_clone.f90
|
||||
impl/smoother/amg_d_jac_smoother_dmp.f90
|
||||
impl/smoother/amg_z_base_smoother_cnv.f90
|
||||
impl/smoother/amg_s_jac_smoother_apply.f90
|
||||
impl/smoother/amg_z_jac_smoother_bld.f90
|
||||
impl/smoother/amg_c_as_smoother_clone.f90
|
||||
impl/smoother/amg_d_as_smoother_apply_vect.f90
|
||||
impl/smoother/amg_d_poly_smoother_descr.f90
|
||||
impl/smoother/amg_s_as_smoother_csetc.f90
|
||||
impl/smoother/amg_z_base_smoother_cseti.f90
|
||||
impl/smoother/amg_s_base_smoother_cseti.f90
|
||||
impl/smoother/amg_s_base_smoother_free.f90
|
||||
impl/smoother/amg_d_jac_smoother_clone.f90
|
||||
impl/smoother/amg_d_jac_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_as_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_poly_smoother_descr.f90
|
||||
impl/smoother/amg_z_as_smoother_cseti.f90
|
||||
impl/smoother/amg_s_as_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_jac_smoother_csetr.f90
|
||||
impl/smoother/amg_d_base_smoother_free.f90
|
||||
impl/smoother/amg_z_as_smoother_bld.f90
|
||||
impl/smoother/amg_s_base_smoother_clear_data.f90
|
||||
impl/smoother/amg_c_jac_smoother_bld.f90
|
||||
impl/smoother/amg_d_as_smoother_restr_v.f90
|
||||
impl/smoother/amg_c_as_smoother_check.f90
|
||||
impl/smoother/amg_d_poly_smoother_cseti.f90
|
||||
impl/smoother/amg_d_as_smoother_clone.f90
|
||||
impl/smoother/amg_z_as_smoother_clear_data.f90
|
||||
impl/smoother/amg_d_as_smoother_free.f90
|
||||
impl/smoother/amg_s_as_smoother_cnv.f90
|
||||
impl/smoother/amg_s_base_smoother_dmp.f90
|
||||
impl/smoother/amg_d_l1_jac_smoother_descr.f90
|
||||
impl/smoother/amg_s_poly_smoother_cnv.f90
|
||||
impl/smoother/amg_d_jac_smoother_csetr.f90
|
||||
impl/smoother/amg_d_base_smoother_apply.f90
|
||||
impl/smoother/amg_s_as_smoother_cseti.f90
|
||||
impl/smoother/amg_s_base_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_base_smoother_cseti.f90
|
||||
impl/smoother/amg_c_as_smoother_cnv.f90
|
||||
impl/smoother/amg_z_jac_smoother_cnv.f90
|
||||
impl/smoother/amg_s_poly_smoother_bld.f90
|
||||
impl/smoother/amg_d_jac_smoother_cseti.f90
|
||||
impl/smoother/amg_s_as_smoother_prol_v.f90
|
||||
impl/smoother/amg_c_as_smoother_restr_a.f90
|
||||
impl/smoother/amg_d_base_smoother_bld.f90
|
||||
impl/smoother/amg_c_jac_smoother_clone.f90
|
||||
impl/smoother/amg_d_jac_smoother_bld.f90
|
||||
impl/smoother/amg_z_jac_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_as_smoother_prol_v.f90
|
||||
impl/smoother/amg_z_jac_smoother_csetc.f90
|
||||
impl/smoother/amg_z_as_smoother_prol_v.f90
|
||||
impl/smoother/amg_d_base_smoother_cnv.f90
|
||||
impl/smoother/amg_c_l1_jac_smoother_bld.f90
|
||||
impl/smoother/amg_z_as_smoother_apply_vect.f90
|
||||
impl/smoother/amg_s_as_smoother_restr_v.f90
|
||||
impl/smoother/amg_d_l1_jac_smoother_bld.f90
|
||||
impl/smoother/amg_s_jac_smoother_bld.f90
|
||||
impl/smoother/amg_s_poly_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_base_smoother_check.f90
|
||||
impl/smoother/amg_z_base_smoother_bld.f90
|
||||
impl/smoother/amg_s_l1_jac_smoother_clone.f90
|
||||
impl/smoother/amg_c_jac_smoother_clone_settings.f90
|
||||
impl/smoother/amg_s_poly_smoother_dmp.f90
|
||||
impl/smoother/amg_c_base_smoother_csetr.f90
|
||||
impl/smoother/amg_d_poly_smoother_clone_settings.f90
|
||||
impl/smoother/amg_z_as_smoother_clone_settings.f90
|
||||
impl/smoother/amg_z_jac_smoother_csetr.f90
|
||||
impl/smoother/amg_d_jac_smoother_csetc.f90
|
||||
impl/smoother/amg_z_base_smoother_dmp.f90
|
||||
impl/smoother/amg_s_jac_smoother_csetr.f90
|
||||
impl/smoother/amg_s_base_smoother_bld.f90
|
||||
impl/smoother/amg_z_jac_smoother_descr.f90
|
||||
impl/smoother/amg_z_jac_smoother_cseti.f90
|
||||
impl/smoother/amg_d_as_smoother_dmp.f90
|
||||
impl/smoother/amg_d_jac_smoother_apply.f90
|
||||
impl/smoother/amg_c_jac_smoother_dmp.f90
|
||||
impl/smoother/amg_z_as_smoother_apply.f90
|
||||
impl/smoother/amg_z_as_smoother_check.f90
|
||||
impl/smoother/amg_z_jac_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_base_smoother_descr.f90
|
||||
impl/smoother/amg_s_jac_smoother_clone.f90
|
||||
impl/smoother/amg_z_jac_smoother_clone.f90
|
||||
impl/smoother/amg_c_as_smoother_clone_settings.f90
|
||||
impl/smoother/amg_c_base_smoother_check.f90
|
||||
impl/smoother/amg_d_poly_smoother_apply_vect.f90
|
||||
impl/smoother/amg_s_l1_jac_smoother_bld.f90
|
||||
impl/smoother/amg_c_as_smoother_apply_vect.f90
|
||||
impl/smoother/amg_z_as_smoother_cnv.f90
|
||||
impl/smoother/amg_z_as_smoother_csetc.f90
|
||||
impl/smoother/amg_d_as_smoother_csetc.f90
|
||||
impl/smoother/amg_d_jac_smoother_cnv.f90
|
||||
impl/smoother/amg_c_as_smoother_csetc.f90
|
||||
impl/smoother/amg_z_base_smoother_clone_settings.f90
|
||||
impl/smoother/amg_s_as_smoother_free.f90
|
||||
impl/smoother/amg_z_base_smoother_free.f90
|
||||
impl/smoother/amg_c_base_smoother_apply.f90
|
||||
impl/smoother/amg_z_l1_jac_smoother_descr.f90
|
||||
impl/smoother/amg_s_as_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_base_smoother_csetr.f90
|
||||
impl/smoother/amg_c_jac_smoother_clear_data.f90
|
||||
impl/smoother/amg_d_poly_smoother_bld.f90
|
||||
impl/smoother/amg_z_base_smoother_csetc.f90
|
||||
impl/smoother/amg_z_base_smoother_clone.f90
|
||||
impl/smoother/amg_s_jac_smoother_apply_vect.f90
|
||||
impl/smoother/amg_z_base_smoother_clear_data.f90
|
||||
impl/smoother/amg_c_base_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_base_smoother_clone.f90
|
||||
impl/smoother/amg_d_base_smoother_cseti.f90
|
||||
impl/smoother/amg_z_l1_jac_smoother_clone.f90
|
||||
impl/smoother/amg_s_l1_jac_smoother_descr.f90
|
||||
impl/smoother/amg_c_jac_smoother_descr.f90
|
||||
impl/smoother/amg_z_base_smoother_check.f90
|
||||
impl/smoother/amg_d_jac_smoother_clear_data.f90
|
||||
impl/smoother/amg_d_as_smoother_prol_a.f90
|
||||
impl/smoother/amg_c_as_smoother_apply.f90
|
||||
impl/smoother/amg_c_base_smoother_cnv.f90
|
||||
impl/smoother/amg_c_jac_smoother_cnv.f90
|
||||
impl/smoother/amg_c_base_smoother_csetc.f90
|
||||
impl/smoother/amg_d_base_smoother_csetc.f90
|
||||
impl/smoother/amg_d_poly_smoother_csetr.f90
|
||||
impl/smoother/amg_c_jac_smoother_cseti.f90
|
||||
impl/smoother/amg_s_base_smoother_cnv.f90
|
||||
impl/smoother/amg_s_poly_smoother_csetr.f90
|
||||
impl/smoother/amg_s_base_smoother_clone_settings.f90
|
||||
impl/smoother/amg_s_as_smoother_restr_a.f90
|
||||
impl/smoother/amg_d_base_smoother_dmp.f90
|
||||
impl/smoother/amg_d_jac_smoother_descr.f90
|
||||
impl/smoother/amg_c_base_smoother_free.f90
|
||||
impl/smoother/amg_c_as_smoother_free.f90
|
||||
impl/smoother/amg_s_jac_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_jac_smoother_cseti.f90
|
||||
impl/smoother/amg_d_poly_smoother_clone.f90
|
||||
impl/smoother/amg_s_jac_smoother_csetc.f90
|
||||
impl/smoother/amg_s_as_smoother_dmp.f90
|
||||
impl/smoother/amg_s_base_smoother_apply.f90
|
||||
impl/smoother/amg_s_as_smoother_clone.f90
|
||||
impl/smoother/amg_c_l1_jac_smoother_descr.f90
|
||||
impl/smoother/amg_s_jac_smoother_cnv.f90
|
||||
impl/smoother/amg_z_as_smoother_free.f90
|
||||
impl/smoother/amg_s_poly_smoother_clone.f90
|
||||
impl/smoother/amg_s_as_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_jac_smoother_dmp.f90
|
||||
impl/smoother/amg_c_base_smoother_clone.f90
|
||||
impl/smoother/amg_d_poly_smoother_csetc.f90
|
||||
impl/smoother/amg_d_as_smoother_cseti.f90
|
||||
impl/smoother/amg_z_base_smoother_descr.f90
|
||||
impl/smoother/amg_d_as_smoother_restr_a.f90
|
||||
impl/smoother/amg_s_base_smoother_check.f90
|
||||
impl/smoother/amg_c_as_smoother_restr_v.f90
|
||||
impl/smoother/amg_d_poly_smoother_cnv.f90
|
||||
impl/smoother/amg_c_jac_smoother_csetc.f90
|
||||
impl/smoother/amg_z_jac_smoother_dmp.f90
|
||||
impl/smoother/amg_z_base_smoother_apply.f90
|
||||
impl/smoother/amg_s_base_smoother_csetr.f90
|
||||
impl/smoother/amg_d_as_smoother_apply.f90
|
||||
impl/smoother/amg_c_as_smoother_prol_a.f90
|
||||
impl/smoother/amg_d_poly_smoother_clear_data.f90
|
||||
impl/smoother/amg_c_base_smoother_descr.f90
|
||||
impl/smoother/amg_d_as_smoother_bld.f90
|
||||
impl/smoother/amg_c_as_smoother_bld.f90
|
||||
impl/smoother/amg_c_as_smoother_cseti.f90
|
||||
impl/smoother/amg_s_as_smoother_bld.f90
|
||||
impl/smoother/amg_z_as_smoother_restr_a.f90
|
||||
impl/smoother/amg_d_as_smoother_clear_data.f90
|
||||
impl/smoother/amg_d_l1_jac_smoother_clone.f90
|
||||
impl/smoother/amg_c_base_smoother_dmp.f90
|
||||
impl/smoother/amg_d_base_smoother_descr.f90
|
||||
impl/smoother/amg_c_base_smoother_apply_vect.f90
|
||||
impl/smoother/amg_d_base_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_base_smoother_clear_data.f90
|
||||
impl/smoother/amg_d_poly_smoother_dmp.f90
|
||||
impl/smoother/amg_s_poly_smoother_cseti.f90
|
||||
impl/smoother/amg_s_as_smoother_check.f90
|
||||
impl/smoother/amg_s_jac_smoother_descr.f90
|
||||
impl/smoother/amg_d_jac_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_as_smoother_prol_v.f90
|
||||
impl/smoother/amg_z_jac_smoother_apply.f90
|
||||
impl/smoother/amg_d_as_smoother_cnv.f90
|
||||
impl/smoother/amg_c_jac_smoother_apply_vect.f90
|
||||
impl/smoother/amg_c_as_smoother_dmp.f90
|
||||
impl/smoother/amg_c_base_smoother_bld.f90
|
||||
impl/smoother/amg_d_as_smoother_clone_settings.f90
|
||||
impl/smoother/amg_d_base_smoother_clear_data.f90
|
||||
impl/smoother/amg_s_jac_smoother_clone_settings.f90
|
||||
impl/smoother/amg_z_as_smoother_dmp.f90
|
||||
impl/smoother/amg_z_as_smoother_clone.f90
|
||||
impl/smoother/amg_z_as_smoother_restr_v.f90
|
||||
impl/smoother/amg_z_as_smoother_prol_a.f90
|
||||
impl/smoother/amg_z_base_smoother_apply_vect.f90
|
||||
impl/amg_d_smoothers_bld.f90
|
||||
impl/amg_zprecset.F90
|
||||
impl/amg_d_hierarchy_rebld.f90
|
||||
impl/amg_d_extprol_bld.F90
|
||||
impl/amg_dprecset.F90
|
||||
impl/amg_scprecset.F90
|
||||
impl/amg_sprecset.F90
|
||||
impl/amg_dmlprec_bld.f90
|
||||
impl/amg_zmlprec_aply.f90
|
||||
impl/aggregator/amg_d_dec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_s_parmatch_aggregator_mat_asb.F90
|
||||
impl/aggregator/amg_s_parmatch_aggregator_tprol.F90
|
||||
impl/aggregator/amg_z_dec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_saggrmat_smth_bld.f90
|
||||
impl/aggregator/amg_s_soc2_map_bld.F90
|
||||
impl/aggregator/amg_s_parmatch_spmm_bld_inner.F90
|
||||
impl/aggregator/amg_caggrmat_minnrg_bld.f90
|
||||
impl/aggregator/amg_d_soc2_map_bld.F90
|
||||
impl/aggregator/amg_s_dec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_s_parmatch_aggregator_inner_mat_asb.F90
|
||||
impl/aggregator/amg_s_dec_aggregator_mat_bld.f90
|
||||
impl/aggregator/amg_c_dec_aggregator_mat_asb.f90
|
||||
impl/aggregator/amg_s_rap.f90
|
||||
impl/aggregator/amg_s_map_to_tprol.f90
|
||||
impl/aggregator/amg_d_parmatch_aggregator_tprol.F90
|
||||
impl/aggregator/amg_saggrmat_nosmth_bld.f90
|
||||
impl/aggregator/amg_c_soc1_map_bld.F90
|
||||
impl/aggregator/amg_d_parmatch_aggregator_mat_asb.F90
|
||||
impl/aggregator/amg_zaggrmat_smth_bld.f90
|
||||
impl/aggregator/amg_d_parmatch_smth_bld.F90
|
||||
impl/aggregator/amg_caggrmat_nosmth_bld.f90
|
||||
impl/aggregator/amg_c_map_to_tprol.f90
|
||||
impl/aggregator/amg_d_rap.f90
|
||||
impl/aggregator/amg_d_map_to_tprol.f90
|
||||
impl/aggregator/amg_daggrmat_minnrg_bld.f90
|
||||
impl/aggregator/amg_d_dec_aggregator_mat_asb.f90
|
||||
impl/aggregator/amg_z_dec_aggregator_mat_bld.f90
|
||||
impl/aggregator/amg_d_parmatch_spmm_bld.F90
|
||||
impl/aggregator/amg_d_parmatch_aggregator_mat_bld.F90
|
||||
impl/aggregator/amg_d_ptap_bld.f90
|
||||
impl/aggregator/amg_z_symdec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_s_symdec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_z_soc1_map_bld.F90
|
||||
impl/aggregator/amg_d_parmatch_unsmth_bld.F90
|
||||
impl/aggregator/amg_z_map_to_tprol.f90
|
||||
impl/aggregator/amg_d_soc1_map_bld.F90
|
||||
impl/aggregator/amg_d_parmatch_spmm_bld_ov.F90
|
||||
impl/aggregator/amg_s_parmatch_aggregator_mat_bld.F90
|
||||
impl/aggregator/amg_s_parmatch_unsmth_bld.F90
|
||||
impl/aggregator/amg_d_parmatch_aggregator_inner_mat_asb.F90
|
||||
impl/aggregator/amg_s_parmatch_spmm_bld.F90
|
||||
impl/aggregator/amg_c_symdec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_zaggrmat_minnrg_bld.f90
|
||||
impl/aggregator/amg_c_dec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_z_dec_aggregator_mat_asb.f90
|
||||
impl/aggregator/amg_c_rap.f90
|
||||
impl/aggregator/amg_s_parmatch_spmm_bld_ov.F90
|
||||
impl/aggregator/amg_s_ptap_bld.f90
|
||||
impl/aggregator/amg_s_soc1_map_bld.F90
|
||||
impl/aggregator/amg_d_dec_aggregator_mat_bld.f90
|
||||
impl/aggregator/amg_z_ptap_bld.f90
|
||||
impl/aggregator/amg_daggrmat_smth_bld.f90
|
||||
impl/aggregator/amg_z_soc2_map_bld.F90
|
||||
impl/aggregator/amg_caggrmat_smth_bld.f90
|
||||
impl/aggregator/amg_saggrmat_minnrg_bld.f90
|
||||
impl/aggregator/amg_c_soc2_map_bld.F90
|
||||
impl/aggregator/amg_s_dec_aggregator_mat_asb.f90
|
||||
impl/aggregator/amg_z_rap.f90
|
||||
impl/aggregator/amg_s_parmatch_smth_bld.F90
|
||||
impl/aggregator/amg_c_dec_aggregator_mat_bld.f90
|
||||
impl/aggregator/amg_daggrmat_nosmth_bld.f90
|
||||
impl/aggregator/amg_d_symdec_aggregator_tprol.f90
|
||||
impl/aggregator/amg_d_parmatch_spmm_bld_inner.F90
|
||||
impl/aggregator/amg_c_ptap_bld.f90
|
||||
impl/aggregator/amg_zaggrmat_nosmth_bld.f90
|
||||
impl/amg_cmlprec_aply.f90
|
||||
impl/amg_cmlprec_bld.f90
|
||||
amg_d_invt_solver.f90
|
||||
amg_c_id_solver.f90
|
||||
amg_base_ainv_mod.F90
|
||||
amg_d_matchboxp_mod.F90
|
||||
amg_z_base_smoother_mod.f90
|
||||
amg_s_invk_solver.f90
|
||||
amg_c_base_solver_mod.f90
|
||||
amg_s_ilu_solver.f90
|
||||
amg_z_ilu_fact_mod.f90
|
||||
amg_prec_mod.f90
|
||||
amg_d_gs_solver.f90
|
||||
amg_d_jac_smoother.f90
|
||||
amg_z_symdec_aggregator_mod.f90
|
||||
amg_s_gs_solver.f90
|
||||
amg_ainv_mod.f90
|
||||
amg_d_parmatch_aggregator_mod.F90
|
||||
amg_z_as_smoother.f90
|
||||
amg_c_inner_mod.f90
|
||||
amg_d_poly_smoother.f90
|
||||
amg_z_onelev_mod.f90
|
||||
amg_z_diag_solver.f90
|
||||
amg_c_symdec_aggregator_mod.f90
|
||||
amg_c_prec_mod.f90
|
||||
amg_d_sludist_solver.F90
|
||||
amg_d_base_solver_mod.f90
|
||||
amg_c_dec_aggregator_mod.f90
|
||||
amg_c_ilu_fact_mod.f90
|
||||
amg_s_onelev_mod.f90
|
||||
amg_d_base_ainv_mod.f90
|
||||
amg_d_invk_solver.f90
|
||||
amg_z_invt_solver.f90
|
||||
amg_z_prec_mod.f90
|
||||
amg_s_prec_mod.f90
|
||||
amg_d_mumps_solver.F90
|
||||
amg_d_umf_solver.F90
|
||||
# amg_d_hybrid_aggregator_mod.F90
|
||||
amg_d_id_solver.f90
|
||||
# amg_c_hybrid_aggregator_mod.F90
|
||||
amg_z_base_ainv_mod.f90
|
||||
amg_z_sludist_solver.F90
|
||||
amg_d_ilu_solver.f90
|
||||
amg_s_base_ainv_mod.f90
|
||||
amg_c_invt_solver.f90
|
||||
# amg_s_hybrid_aggregator_mod.F90
|
||||
amg_d_prec_type.f90
|
||||
amg_d_base_smoother_mod.f90
|
||||
amg_c_base_ainv_mod.f90
|
||||
amg_s_prec_type.f90
|
||||
amg_s_diag_solver.f90
|
||||
amg_z_base_aggregator_mod.f90
|
||||
amg_z_dec_aggregator_mod.f90
|
||||
amg_prec_type.f90
|
||||
amg_s_invt_solver.f90
|
||||
amg_s_base_smoother_mod.f90
|
||||
amg_c_ainv_solver.F90
|
||||
amg_d_dec_aggregator_mod.f90
|
||||
amg_s_slu_solver.F90
|
||||
amg_d_diag_solver.f90
|
||||
amg_z_id_solver.f90
|
||||
amg_c_slu_solver.F90
|
||||
amg_s_jac_smoother.f90
|
||||
amg_s_dec_aggregator_mod.f90
|
||||
amg_d_inner_mod.f90
|
||||
amg_s_mumps_solver.F90
|
||||
amg_d_jac_solver.f90
|
||||
amg_s_krm_solver.f90
|
||||
amg_s_as_smoother.f90
|
||||
amg_d_onelev_mod.f90
|
||||
amg_z_jac_solver.f90
|
||||
amg_d_symdec_aggregator_mod.f90
|
||||
amg_c_onelev_mod.f90
|
||||
amg_s_parmatch_aggregator_mod.F90
|
||||
amg_c_ilu_solver.f90
|
||||
amg_d_poly_coeff_mod.f90
|
||||
amg_s_jac_solver.f90
|
||||
amg_base_prec_type.F90
|
||||
amg_s_base_aggregator_mod.f90
|
||||
amg_z_ainv_solver.F90
|
||||
amg_d_prec_mod.f90
|
||||
amg_c_prec_type.f90
|
||||
amg_d_as_smoother.f90
|
||||
amg_z_ilu_solver.f90
|
||||
amg_c_base_aggregator_mod.f90
|
||||
amg_s_id_solver.f90
|
||||
amg_c_krm_solver.f90
|
||||
amg_z_jac_smoother.f90
|
||||
amg_c_as_smoother.f90
|
||||
amg_z_invk_solver.f90
|
||||
amg_d_krm_solver.f90
|
||||
amg_c_invk_solver.f90
|
||||
amg_c_mumps_solver.F90
|
||||
amg_c_jac_solver.f90
|
||||
amg_z_umf_solver.F90
|
||||
amg_s_symdec_aggregator_mod.f90
|
||||
amg_s_poly_smoother.f90
|
||||
amg_s_inner_mod.f90
|
||||
amg_s_ilu_fact_mod.f90
|
||||
amg_z_mumps_solver.F90
|
||||
amg_c_jac_smoother.f90
|
||||
)
|
||||
foreach(file IN LISTS AMG_amgprec_source_files)
|
||||
list(APPEND amgprec_source_files ${CMAKE_CURRENT_LIST_DIR}/${file})
|
||||
endforeach()
|
||||
|
||||
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_dslu_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_zslu_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_sslu_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_dumf_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_cslu_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_dslud_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_zumf_interface.c)
|
||||
list(APPEND AMG_amgprec_source_C_files impl/amg_zslud_interface.c)
|
||||
|
||||
|
||||
set(AMG_amgprec_source_CPP_files
|
||||
impl/aggregator/computeCandidateMate.cpp
|
||||
impl/aggregator/processExposedVertex.cpp
|
||||
impl/aggregator/processMatchedVertices.cpp
|
||||
impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP.cpp
|
||||
impl/aggregator/processCrossEdge.cpp
|
||||
impl/aggregator/findOwnerOfGhost.cpp
|
||||
impl/aggregator/MatchBoxPC.cpp
|
||||
impl/aggregator/queueTransfer.cpp
|
||||
impl/aggregator/clean.cpp
|
||||
impl/aggregator/algoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC.cpp
|
||||
impl/aggregator/extractUChunk.cpp
|
||||
impl/aggregator/processMatchedVerticesAndSendMessages.cpp
|
||||
impl/aggregator/sendBundledMessages.cpp
|
||||
impl/aggregator/initialize.cpp
|
||||
impl/aggregator/isAlreadyMatched.cpp
|
||||
impl/aggregator/processMessages.cpp
|
||||
impl/aggregator/parallelComputeCandidateMateB.cpp
|
||||
)
|
||||
|
||||
|
||||
foreach(file IN LISTS AMG_amgprec_source_C_files)
|
||||
list(APPEND amgprec_source_C_files ${CMAKE_CURRENT_LIST_DIR}/${file})
|
||||
endforeach()
|
||||
|
||||
|
||||
foreach(file IN LISTS AMG_amgprec_source_CPP_files)
|
||||
list(APPEND amgprec_source_CPP_files ${CMAKE_CURRENT_LIST_DIR}/${file})
|
||||
endforeach()
|
||||
+8
-10
@@ -58,23 +58,21 @@ MODOBJS=amg_base_prec_type.o amg_prec_type.o amg_prec_mod.o \
|
||||
$(SMODOBJS) $(DMODOBJS) $(CMODOBJS) $(ZMODOBJS)
|
||||
|
||||
|
||||
OBJS=$(MODOBJS)
|
||||
|
||||
LOCAL_MODS=$(MODOBJS:.o=$(.mod))
|
||||
LIBNAME=libamg_prec.a
|
||||
|
||||
all: objs impld
|
||||
all: mods objs impld
|
||||
|
||||
objs: $(OBJS)
|
||||
/bin/cp -p amg_const.h $(INCDIR)
|
||||
mods: $(MODOBJS)
|
||||
/bin/cp -p amg_const.h amg_config.h $(INCDIR)
|
||||
/bin/cp -p *$(.mod) $(MODDIR)
|
||||
|
||||
impld: objs
|
||||
objs: mods impld
|
||||
impld: mods
|
||||
cd impl && $(MAKE)
|
||||
|
||||
lib: $(OBJS) impld
|
||||
lib: mods impld
|
||||
cd impl && $(MAKE) lib
|
||||
$(AR) $(HERE)/$(LIBNAME) $(OBJS)
|
||||
$(AR) $(HERE)/$(LIBNAME) $(MODOBJS)
|
||||
$(RANLIB) $(HERE)/$(LIBNAME)
|
||||
/bin/cp -p $(HERE)/$(LIBNAME) $(LIBDIR)
|
||||
|
||||
@@ -221,7 +219,7 @@ veryclean: clean
|
||||
/bin/rm -f $(LIBNAME)
|
||||
|
||||
clean: implclean
|
||||
/bin/rm -f $(OBJS) $(LOCAL_MODS) *$(.mod)
|
||||
/bin/rm -f $(MODOBJS) $(LOCAL_MODS) *$(.mod)
|
||||
|
||||
implclean:
|
||||
cd impl && $(MAKE) clean
|
||||
|
||||
@@ -55,10 +55,6 @@ module amg_base_ainv_mod
|
||||
integer, parameter :: amg_ainv_llk_noth_ = amg_ainv_s_ft_llk_ + 1
|
||||
integer, parameter :: amg_ainv_mlk_ = amg_ainv_llk_noth_ + 1
|
||||
integer, parameter :: amg_ainv_lmx_ = amg_ainv_mlk_
|
||||
#if defined(HAVE_TUMA_SAINV)
|
||||
integer, parameter :: amg_ainv_s_tuma_ = amg_ainv_lmx_ + 1
|
||||
integer, parameter :: amg_ainv_l_tuma_ = amg_ainv_s_tuma_ + 1
|
||||
#endif
|
||||
|
||||
|
||||
end module amg_base_ainv_mod
|
||||
|
||||
@@ -81,9 +81,9 @@ module amg_base_prec_type
|
||||
!
|
||||
! Version numbers
|
||||
!
|
||||
character(len=*), parameter :: amg_version_string_ = "1.1.0"
|
||||
character(len=*), parameter :: amg_version_string_ = "1.2.0"
|
||||
integer(psb_ipk_), parameter :: amg_version_major_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_version_minor_ = 2
|
||||
integer(psb_ipk_), parameter :: amg_patchlevel_ = 0
|
||||
|
||||
type amg_ml_parms
|
||||
@@ -297,9 +297,10 @@ module amg_base_prec_type
|
||||
!
|
||||
! Legal values for entry: amg_aggr_filter_
|
||||
!
|
||||
integer(psb_ipk_), parameter :: amg_no_filter_mat_ = 0
|
||||
integer(psb_ipk_), parameter :: amg_filter_mat_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_max_filter_mat_ = amg_filter_mat_
|
||||
integer(psb_ipk_), parameter :: amg_no_filter_mat_ = 0
|
||||
integer(psb_ipk_), parameter :: amg_filter_mat_ = 1
|
||||
integer(psb_ipk_), parameter :: amg_filter_prow_mat_ = 2
|
||||
integer(psb_ipk_), parameter :: amg_max_filter_mat_ = amg_filter_prow_mat_
|
||||
!
|
||||
! Legal values for entry: amg_aggr_ord_
|
||||
!
|
||||
@@ -380,7 +381,8 @@ module amg_base_prec_type
|
||||
& aggr_prols(0:4)=(/'unsmoothed ','smoothed ',&
|
||||
& 'l1-smoothed ','min energy ','bizr. smoothed'/)
|
||||
character(len=15), parameter, private :: &
|
||||
& aggr_filters(0:1)=(/'no filtering ','filtering '/)
|
||||
& aggr_filters(0:2)=(/'no filtering ','filtering ',&
|
||||
& 'filtering rsum'/)
|
||||
character(len=15), parameter, private :: &
|
||||
& matrix_names(0:1)=(/'distributed ','replicated '/)
|
||||
character(len=18), parameter, private :: &
|
||||
@@ -591,6 +593,8 @@ contains
|
||||
val = amg_eig_est_
|
||||
case('FILTER')
|
||||
val = amg_filter_mat_
|
||||
case('FILTERROWSUM')
|
||||
val = amg_filter_prow_mat_
|
||||
case('NOFILTER','NO_FILTER')
|
||||
val = amg_no_filter_mat_
|
||||
case('OUTER_SWEEPS')
|
||||
@@ -617,9 +621,13 @@ contains
|
||||
|
||||
subroutine amg_warn_coarse_mat(val,expected)
|
||||
integer(psb_ipk_) :: val, expected
|
||||
integer(psb_mpk_) :: mval, mexp
|
||||
if (val /= expected) then
|
||||
mval = val
|
||||
mexp = expected
|
||||
write(0,*) 'Warning: resetting COARSE_MAT on an existing hierarchy from ',&
|
||||
& amg_get_coarse_mat_name(val), ' to ',amg_get_coarse_mat_name(expected)
|
||||
& amg_get_coarse_mat_name(mval), &
|
||||
& ' to ',amg_get_coarse_mat_name(mexp)
|
||||
end if
|
||||
end subroutine amg_warn_coarse_mat
|
||||
|
||||
@@ -1203,7 +1211,7 @@ contains
|
||||
implicit none
|
||||
type(psb_ctxt_type), intent(in) :: ctxt
|
||||
type(amg_ml_parms), intent(inout) :: dat
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_mpk_), intent(in), optional :: root
|
||||
|
||||
call psb_bcast(ctxt,dat%sweeps_pre,root)
|
||||
call psb_bcast(ctxt,dat%sweeps_post,root)
|
||||
@@ -1225,7 +1233,7 @@ contains
|
||||
implicit none
|
||||
type(psb_ctxt_type), intent(in) :: ctxt
|
||||
type(amg_sml_parms), intent(inout) :: dat
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_mpk_), intent(in), optional :: root
|
||||
|
||||
call psb_bcast(ctxt,dat%amg_ml_parms,root)
|
||||
call psb_bcast(ctxt,dat%aggr_omega_val,root)
|
||||
@@ -1236,7 +1244,7 @@ contains
|
||||
implicit none
|
||||
type(psb_ctxt_type), intent(in) :: ctxt
|
||||
type(amg_dml_parms), intent(inout) :: dat
|
||||
integer(psb_ipk_), intent(in), optional :: root
|
||||
integer(psb_mpk_), intent(in), optional :: root
|
||||
|
||||
call psb_bcast(ctxt,dat%amg_ml_parms,root)
|
||||
call psb_bcast(ctxt,dat%aggr_omega_val,root)
|
||||
|
||||
@@ -62,9 +62,6 @@ module amg_c_ainv_solver
|
||||
procedure, pass(sv) :: cseti => amg_c_ainv_solver_cseti
|
||||
procedure, pass(sv) :: csetc => amg_c_ainv_solver_csetc
|
||||
procedure, pass(sv) :: csetr => amg_c_ainv_solver_csetr
|
||||
!!$ procedure, pass(sv) :: seti => amg_c_ainv_solver_seti
|
||||
!!$ procedure, pass(sv) :: setc => amg_c_ainv_solver_setc
|
||||
!!$ procedure, pass(sv) :: setr => amg_c_ainv_solver_setr
|
||||
procedure, pass(sv) :: descr => amg_c_ainv_solver_descr
|
||||
procedure, pass(sv) :: default => c_ainv_solver_default
|
||||
procedure, nopass :: stringval => c_ainv_stringval
|
||||
@@ -91,9 +88,9 @@ module amg_c_ainv_solver
|
||||
import :: psb_desc_type, psb_cspmat_type, psb_c_base_sparse_mat, &
|
||||
& amg_c_base_solver_type, psb_dpk_, amg_c_ainv_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_c_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_c_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_c_ainv_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
! Do nothing
|
||||
|
||||
info = psb_success_
|
||||
return
|
||||
end subroutine amg_c_base_aggregator_set_aggr_type
|
||||
|
||||
@@ -486,6 +486,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='c_base_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
|
||||
@@ -150,7 +150,7 @@ contains
|
||||
class(amg_c_dec_aggregator_type), intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
select case(parms%aggr_type)
|
||||
case (amg_noalg_)
|
||||
ag%soc_map_bld => null()
|
||||
@@ -192,6 +192,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
!
|
||||
!
|
||||
! AMG4PSBLAS version 1.0
|
||||
! Algebraic Multigrid Package
|
||||
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||
!
|
||||
! (C) Copyright 2020
|
||||
!
|
||||
! Salvatore Filippone
|
||||
! Pasqua D'Ambra
|
||||
! Fabio Durastante
|
||||
!
|
||||
! Redistribution and use in source and binary forms, with or without
|
||||
! modification, are permitted provided that the following conditions
|
||||
! are met:
|
||||
! 1. Redistributions of source code must retain the above copyright
|
||||
! notice, this list of conditions and the following disclaimer.
|
||||
! 2. Redistributions in binary form must reproduce the above copyright
|
||||
! notice, this list of conditions, and the following disclaimer in the
|
||||
! documentation and/or other materials provided with the distribution.
|
||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
! not be used to endorse or promote products derived from this
|
||||
! software without specific written permission.
|
||||
!
|
||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
! The aggregator object hosts the aggregation method for building
|
||||
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||
! presented in
|
||||
!
|
||||
! S. Gratton, P. Henon, P. Jiranek and X. Vasseur:
|
||||
! Reducing complexity of algebraic multigrid by aggregation
|
||||
! Numerical Lin. Algebra with Applications, 2016, 23:501-518
|
||||
!
|
||||
module amg_c_hybrid_aggregator_mod
|
||||
|
||||
use amg_c_dec_aggregator_mod
|
||||
!
|
||||
! sm - class(amg_T_base_smoother_type), allocatable
|
||||
! The current level preconditioner (aka smoother).
|
||||
! parms - type(amg_RTml_parms)
|
||||
! The parameters defining the multilevel strategy.
|
||||
! ac - The local part of the current-level matrix, built by
|
||||
! coarsening the previous-level matrix.
|
||||
! desc_ac - type(psb_desc_type).
|
||||
! The communication descriptor associated to the matrix
|
||||
! stored in ac.
|
||||
! base_a - type(psb_Tspmat_type), pointer.
|
||||
! Pointer (really a pointer!) to the local part of the current
|
||||
! matrix (so we have a unified treatment of residuals).
|
||||
! We need this to avoid passing explicitly the current matrix
|
||||
! to the routine which applies the preconditioner.
|
||||
! base_desc - type(psb_desc_type), pointer.
|
||||
! Pointer to the communication descriptor associated to the
|
||||
! matrix pointed by base_a.
|
||||
! map - Stores the maps (restriction and prolongation) between the
|
||||
! vector spaces associated to the index spaces of the previous
|
||||
! and current levels.
|
||||
!
|
||||
! Methods:
|
||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||
! is appropriate for the current object, then call the corresponding method for
|
||||
! the contained object.
|
||||
! As an example: the descr() method prints out a description of the
|
||||
! level. It starts by invoking the descr() method of the parms object,
|
||||
! then calls the descr() method of the smoother object.
|
||||
!
|
||||
! descr - Prints a description of the object.
|
||||
! default - Set default values
|
||||
! dump - Dump to file object contents
|
||||
! set - Sets various parameters; when a request is unknown
|
||||
! it is passed to the smoother object for further processing.
|
||||
! check - Sanity checks.
|
||||
! sizeof - Total memory occupation in bytes
|
||||
! get_nzeros - Number of nonzeros
|
||||
!
|
||||
!
|
||||
type, extends(amg_c_dec_aggregator_type) :: amg_c_hybrid_aggregator_type
|
||||
|
||||
contains
|
||||
procedure, pass(ag) :: bld_tprol => amg_c_hybrid_aggregator_build_tprol
|
||||
procedure, nopass :: fmt => amg_c_hybrid_aggregator_fmt
|
||||
end type amg_c_hybrid_aggregator_type
|
||||
|
||||
|
||||
interface
|
||||
subroutine amg_c_hybrid_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
import :: amg_c_hybrid_aggregator_type, psb_desc_type, psb_cspmat_type, psb_spk_, &
|
||||
& psb_ipk_, psb_long_int_k_, amg_sml_parms
|
||||
implicit none
|
||||
class(amg_c_hybrid_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_cspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_cspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_c_hybrid_aggregator_build_tprol
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
|
||||
function amg_c_hybrid_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Hybrid Decoupled aggregation"
|
||||
end function amg_c_hybrid_aggregator_fmt
|
||||
|
||||
|
||||
end module amg_c_hybrid_aggregator_mod
|
||||
@@ -79,9 +79,9 @@ module amg_c_invk_solver
|
||||
import :: psb_desc_type, psb_cspmat_type, psb_c_base_sparse_mat, &
|
||||
& amg_c_base_solver_type, psb_spk_, amg_c_invk_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_c_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_c_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_c_invk_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -79,9 +79,9 @@ module amg_c_invt_solver
|
||||
import :: psb_desc_type, psb_cspmat_type, psb_c_base_sparse_mat, &
|
||||
& amg_c_base_solver_type, psb_spk_, amg_c_invt_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_c_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_c_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_c_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_c_invt_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ module amg_c_jac_smoother
|
||||
subroutine amg_c_jac_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_c_jac_smoother_type, psb_spk_, &
|
||||
& amg_c_base_smoother_type, psb_ipk_
|
||||
class(amg_c_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_c_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_c_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_c_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_c_jac_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
!
|
||||
module amg_c_mumps_solver
|
||||
use amg_c_base_solver_mod
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
|
||||
use cmumps_struc_def
|
||||
#endif
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
|
||||
include 'cmumps_struc.h'
|
||||
#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ module amg_c_mumps_solver
|
||||
end type amg_c_mumps_rcntl_item
|
||||
|
||||
type, extends(amg_c_base_solver_type) :: amg_c_mumps_solver_type
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
type(cmumps_struc), allocatable :: id
|
||||
#else
|
||||
integer, allocatable :: id
|
||||
@@ -189,7 +189,7 @@ contains
|
||||
|
||||
info = 0
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
@@ -239,7 +239,7 @@ contains
|
||||
character(len=20) :: name='c_mumps_solver_clear_data'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
if (allocated(sv%id)) then
|
||||
if (sv%built) then
|
||||
@@ -279,7 +279,7 @@ contains
|
||||
character(len=20) :: name='c_mumps_solver_free'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
call sv%clear_data(info)
|
||||
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
|
||||
@@ -383,7 +383,7 @@ subroutine c_mumps_solver_csetc(sv,what,val,info,idx)
|
||||
|
||||
|
||||
select case(psb_toupper(trim(what)))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
|
||||
#endif
|
||||
@@ -421,7 +421,7 @@ subroutine c_mumps_solver_cseti(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = val
|
||||
case('MUMPS_PRINT_ERR')
|
||||
@@ -467,7 +467,7 @@ subroutine c_mumps_solver_csetr(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_RPAR_ENTRY')
|
||||
if(present(idx)) then
|
||||
! Note: this will allocate %item
|
||||
@@ -504,7 +504,7 @@ subroutine c_mumps_solver_default(sv)
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
if (.not.allocated(sv%id)) then
|
||||
allocate(sv%id,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
@@ -561,7 +561,7 @@ function c_mumps_solver_sizeof(sv) result(val)
|
||||
class(amg_c_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_epk_) :: val
|
||||
integer :: i
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
|
||||
#else
|
||||
val = 0
|
||||
|
||||
@@ -113,6 +113,7 @@ module amg_c_prec_type
|
||||
procedure, pass(prec) :: free => amg_c_prec_free
|
||||
procedure, pass(prec) :: allocate_wrk => amg_c_allocate_wrk
|
||||
procedure, pass(prec) :: free_wrk => amg_c_free_wrk
|
||||
procedure, pass(prec) :: deallocate_wrk => amg_c_free_wrk
|
||||
procedure, pass(prec) :: is_allocated_wrk => amg_c_is_allocated_wrk
|
||||
procedure, pass(prec) :: get_complexity => amg_c_get_compl
|
||||
procedure, pass(prec) :: cmp_complexity => amg_c_cmp_compl
|
||||
|
||||
+262
-206
@@ -51,7 +51,7 @@ module amg_c_slu_solver
|
||||
use iso_c_binding
|
||||
use amg_c_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_c_base_solver_type) :: amg_c_slu_solver_type
|
||||
|
||||
@@ -63,9 +63,9 @@ module amg_c_slu_solver
|
||||
type(c_ptr) :: lufactors=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => c_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => c_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => c_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_c_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_c_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_c_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: free => c_slu_solver_free
|
||||
procedure, pass(sv) :: clear_data => c_slu_solver_clear_data
|
||||
procedure, pass(sv) :: descr => c_slu_solver_descr
|
||||
@@ -76,9 +76,8 @@ module amg_c_slu_solver
|
||||
end type amg_c_slu_solver_type
|
||||
|
||||
|
||||
private :: c_slu_solver_bld, c_slu_solver_apply, &
|
||||
& c_slu_solver_free, c_slu_solver_descr, &
|
||||
& c_slu_solver_sizeof, c_slu_solver_apply_vect, &
|
||||
private :: c_slu_solver_free, c_slu_solver_descr, &
|
||||
& c_slu_solver_sizeof, &
|
||||
& c_slu_solver_get_fmt, c_slu_solver_get_id, &
|
||||
& c_slu_solver_clear_data
|
||||
private :: c_slu_solver_finalize
|
||||
@@ -118,207 +117,264 @@ module amg_c_slu_solver
|
||||
end function amg_cslu_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_c_slu_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_cspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_cspmat_type), intent(in), target, optional :: b
|
||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_c_slu_solver_bld
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_c_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_c_vect_type),intent(inout) :: x
|
||||
type(psb_c_vect_type),intent(inout) :: y
|
||||
complex(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
type(psb_c_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_c_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_c_slu_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_c_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_c_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
complex(psb_spk_),intent(inout) :: x(:)
|
||||
complex(psb_spk_),intent(inout) :: y(:)
|
||||
complex(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_spk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_c_slu_solver_apply
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine c_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
complex(psb_spk_),intent(inout) :: x(:)
|
||||
complex(psb_spk_),intent(inout) :: y(:)
|
||||
complex(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_spk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
complex(psb_spk_), pointer :: ww(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='c_slu_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='complex(psb_spk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
ww(1:n_row) = x(1:n_row)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_cslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('T')
|
||||
info = amg_cslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('C')
|
||||
info = amg_cslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_, &
|
||||
& name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) &
|
||||
& call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,&
|
||||
& name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine c_slu_solver_apply
|
||||
|
||||
subroutine c_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_c_vect_type),intent(inout) :: x
|
||||
type(psb_c_vect_type),intent(inout) :: y
|
||||
complex(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
type(psb_c_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_c_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='c_slu_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine c_slu_solver_apply_vect
|
||||
|
||||
subroutine c_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_cspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_cspmat_type), intent(in), target, optional :: b
|
||||
class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_cspmat_type) :: atmp
|
||||
type(psb_c_csc_sparse_mat) :: acsc
|
||||
type(psb_c_coo_sparse_mat) :: acoo
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='c_slu_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
nrow_a = atmp%get_nrows()
|
||||
call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
call acsc%mv_from_coo(acoo,info)
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entries to call C-base SuperLU
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_cslu_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%icp,acsc%ia,sv%lufactors)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_cslu_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine c_slu_solver_bld
|
||||
!!$ subroutine c_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
!!$ complex(psb_spk_),intent(inout) :: x(:)
|
||||
!!$ complex(psb_spk_),intent(inout) :: y(:)
|
||||
!!$ complex(psb_spk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ complex(psb_spk_),intent(inout), optional :: initu(:)
|
||||
!!$
|
||||
!!$ integer :: n_row,n_col
|
||||
!!$ complex(psb_spk_), pointer :: ww(:)
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act
|
||||
!!$ character :: trans_
|
||||
!!$ character(len=20) :: name='c_slu_solver_apply'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$
|
||||
!!$ trans_ = psb_toupper(trans)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ case('T','C')
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ n_row = desc_data%get_local_rows()
|
||||
!!$ n_col = desc_data%get_local_cols()
|
||||
!!$
|
||||
!!$ if (n_col <= size(work)) then
|
||||
!!$ ww => work(1:n_col)
|
||||
!!$ else
|
||||
!!$ allocate(ww(n_col),stat=info)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_alloc_request_
|
||||
!!$ call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
!!$ & a_err='complex(psb_spk_)')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ ww(1:n_row) = x(1:n_row)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ info = amg_cslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('T')
|
||||
!!$ info = amg_cslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('C')
|
||||
!!$ info = amg_cslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_internal_error_, &
|
||||
!!$ & name,a_err='Invalid TRANS in ILU subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,&
|
||||
!!$ & name,a_err='Error in subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ if (n_col > size(work)) then
|
||||
!!$ deallocate(ww)
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine c_slu_solver_apply
|
||||
!!$
|
||||
!!$ subroutine c_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,wv,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
!!$ type(psb_c_vect_type),intent(inout) :: x
|
||||
!!$ type(psb_c_vect_type),intent(inout) :: y
|
||||
!!$ complex(psb_spk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ complex(psb_spk_),target, intent(inout) :: work(:)
|
||||
!!$ type(psb_c_vect_type),intent(inout) :: wv(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ type(psb_c_vect_type),intent(inout), optional :: initu
|
||||
!!$
|
||||
!!$ integer :: err_act
|
||||
!!$ character(len=20) :: name='c_slu_solver_apply_vect'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ call x%v%sync()
|
||||
!!$ call y%v%sync()
|
||||
!!$ call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
!!$ call y%v%set_host()
|
||||
!!$ if (info /= 0) goto 9999
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine c_slu_solver_apply_vect
|
||||
!!$
|
||||
!!$ subroutine c_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
!!$
|
||||
!!$ use psb_base_mod
|
||||
!!$
|
||||
!!$ Implicit None
|
||||
!!$
|
||||
!!$ ! Arguments
|
||||
!!$ type(psb_cspmat_type), intent(in), target :: a
|
||||
!!$ Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
!!$ class(amg_c_slu_solver_type), intent(inout) :: sv
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ type(psb_cspmat_type), intent(in), target, optional :: b
|
||||
!!$ class(psb_c_base_sparse_mat), intent(in), optional :: amold
|
||||
!!$ class(psb_c_base_vect_type), intent(in), optional :: vmold
|
||||
!!$ class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
!!$ ! Local variables
|
||||
!!$ type(psb_cspmat_type) :: atmp
|
||||
!!$ type(psb_c_csc_sparse_mat) :: acsc
|
||||
!!$ type(psb_c_coo_sparse_mat) :: acoo
|
||||
!!$ integer :: n_row,n_col, nrow_a, nztota
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
!!$ character(len=20) :: name='c_slu_solver_bld', ch_err
|
||||
!!$
|
||||
!!$ info=psb_success_
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$ debug_unit = psb_get_debug_unit()
|
||||
!!$ debug_level = psb_get_debug_level()
|
||||
!!$ ctxt = desc_a%get_context()
|
||||
!!$ call psb_info(ctxt, me, np)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' start'
|
||||
!!$
|
||||
!!$
|
||||
!!$ n_row = desc_a%get_local_rows()
|
||||
!!$ n_col = desc_a%get_local_cols()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call a%cscnv(atmp,info,type='coo')
|
||||
!!$ call psb_rwextd(n_row,atmp,info,b=b)
|
||||
!!$ call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$ nrow_a = atmp%get_nrows()
|
||||
!!$ call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
!!$ call acsc%mv_from_coo(acoo,info)
|
||||
!!$ nztota = acsc%get_nzeros()
|
||||
!!$ ! Fix the entries to call C-base SuperLU
|
||||
!!$ acsc%ia(:) = acsc%ia(:) - 1
|
||||
!!$ acsc%icp(:) = acsc%icp(:) - 1
|
||||
!!$ info = amg_cslu_fact(nrow_a,nztota,acsc%val,&
|
||||
!!$ & acsc%icp,acsc%ia,sv%lufactors)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_from_subroutine_
|
||||
!!$ ch_err='amg_cslu_fact'
|
||||
!!$ call psb_errpush(info,name,a_err=ch_err)
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call acsc%free()
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' end'
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$ end subroutine c_slu_solver_bld
|
||||
|
||||
subroutine c_slu_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ contains
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef AMG_CONFIG_H
|
||||
#define AMG_CONFIG_H
|
||||
|
||||
#include "psb_config.h"
|
||||
|
||||
@CHAVEUMF@
|
||||
@CHAVESLU@
|
||||
@CSLUVERSION@
|
||||
@CHAVESLUDIST@
|
||||
@CSLUDISTVERSION@
|
||||
@CHAVEMUMPS@
|
||||
@CHAVEMUMPSMODULES@
|
||||
@CHAVEMUMPSINCLUDES@
|
||||
@CXXMATCHBOXBIT@
|
||||
|
||||
|
||||
#endif
|
||||
@@ -62,9 +62,6 @@ module amg_d_ainv_solver
|
||||
procedure, pass(sv) :: cseti => amg_d_ainv_solver_cseti
|
||||
procedure, pass(sv) :: csetc => amg_d_ainv_solver_csetc
|
||||
procedure, pass(sv) :: csetr => amg_d_ainv_solver_csetr
|
||||
!!$ procedure, pass(sv) :: seti => amg_d_ainv_solver_seti
|
||||
!!$ procedure, pass(sv) :: setc => amg_d_ainv_solver_setc
|
||||
!!$ procedure, pass(sv) :: setr => amg_d_ainv_solver_setr
|
||||
procedure, pass(sv) :: descr => amg_d_ainv_solver_descr
|
||||
procedure, pass(sv) :: default => d_ainv_solver_default
|
||||
procedure, nopass :: stringval => d_ainv_stringval
|
||||
@@ -91,9 +88,9 @@ module amg_d_ainv_solver
|
||||
import :: psb_desc_type, psb_dspmat_type, psb_d_base_sparse_mat, &
|
||||
& amg_d_base_solver_type, psb_dpk_, amg_d_ainv_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_d_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_d_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_ainv_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
! Do nothing
|
||||
|
||||
info = psb_success_
|
||||
return
|
||||
end subroutine amg_d_base_aggregator_set_aggr_type
|
||||
|
||||
@@ -486,6 +486,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='d_base_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
|
||||
@@ -150,7 +150,7 @@ contains
|
||||
class(amg_d_dec_aggregator_type), intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
select case(parms%aggr_type)
|
||||
case (amg_noalg_)
|
||||
ag%soc_map_bld => null()
|
||||
@@ -192,6 +192,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
!
|
||||
!
|
||||
! AMG4PSBLAS version 1.0
|
||||
! Algebraic Multigrid Package
|
||||
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||
!
|
||||
! (C) Copyright 2020
|
||||
!
|
||||
! Salvatore Filippone
|
||||
! Pasqua D'Ambra
|
||||
! Fabio Durastante
|
||||
!
|
||||
! Redistribution and use in source and binary forms, with or without
|
||||
! modification, are permitted provided that the following conditions
|
||||
! are met:
|
||||
! 1. Redistributions of source code must retain the above copyright
|
||||
! notice, this list of conditions and the following disclaimer.
|
||||
! 2. Redistributions in binary form must reproduce the above copyright
|
||||
! notice, this list of conditions, and the following disclaimer in the
|
||||
! documentation and/or other materials provided with the distribution.
|
||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
! not be used to endorse or promote products derived from this
|
||||
! software without specific written permission.
|
||||
!
|
||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
! The aggregator object hosts the aggregation method for building
|
||||
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||
! presented in
|
||||
!
|
||||
! S. Gratton, P. Henon, P. Jiranek and X. Vasseur:
|
||||
! Reducing complexity of algebraic multigrid by aggregation
|
||||
! Numerical Lin. Algebra with Applications, 2016, 23:501-518
|
||||
!
|
||||
module amg_d_hybrid_aggregator_mod
|
||||
|
||||
use amg_d_dec_aggregator_mod
|
||||
!
|
||||
! sm - class(amg_T_base_smoother_type), allocatable
|
||||
! The current level preconditioner (aka smoother).
|
||||
! parms - type(amg_RTml_parms)
|
||||
! The parameters defining the multilevel strategy.
|
||||
! ac - The local part of the current-level matrix, built by
|
||||
! coarsening the previous-level matrix.
|
||||
! desc_ac - type(psb_desc_type).
|
||||
! The communication descriptor associated to the matrix
|
||||
! stored in ac.
|
||||
! base_a - type(psb_Tspmat_type), pointer.
|
||||
! Pointer (really a pointer!) to the local part of the current
|
||||
! matrix (so we have a unified treatment of residuals).
|
||||
! We need this to avoid passing explicitly the current matrix
|
||||
! to the routine which applies the preconditioner.
|
||||
! base_desc - type(psb_desc_type), pointer.
|
||||
! Pointer to the communication descriptor associated to the
|
||||
! matrix pointed by base_a.
|
||||
! map - Stores the maps (restriction and prolongation) between the
|
||||
! vector spaces associated to the index spaces of the previous
|
||||
! and current levels.
|
||||
!
|
||||
! Methods:
|
||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||
! is appropriate for the current object, then call the corresponding method for
|
||||
! the contained object.
|
||||
! As an example: the descr() method prints out a description of the
|
||||
! level. It starts by invoking the descr() method of the parms object,
|
||||
! then calls the descr() method of the smoother object.
|
||||
!
|
||||
! descr - Prints a description of the object.
|
||||
! default - Set default values
|
||||
! dump - Dump to file object contents
|
||||
! set - Sets various parameters; when a request is unknown
|
||||
! it is passed to the smoother object for further processing.
|
||||
! check - Sanity checks.
|
||||
! sizeof - Total memory occupation in bytes
|
||||
! get_nzeros - Number of nonzeros
|
||||
!
|
||||
!
|
||||
type, extends(amg_d_dec_aggregator_type) :: amg_d_hybrid_aggregator_type
|
||||
|
||||
contains
|
||||
procedure, pass(ag) :: bld_tprol => amg_d_hybrid_aggregator_build_tprol
|
||||
procedure, nopass :: fmt => amg_d_hybrid_aggregator_fmt
|
||||
end type amg_d_hybrid_aggregator_type
|
||||
|
||||
|
||||
interface
|
||||
subroutine amg_d_hybrid_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
import :: amg_d_hybrid_aggregator_type, psb_desc_type, psb_dspmat_type, psb_dpk_, &
|
||||
& psb_ipk_, psb_long_int_k_, amg_dml_parms
|
||||
implicit none
|
||||
class(amg_d_hybrid_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_dspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_dspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_hybrid_aggregator_build_tprol
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
|
||||
function amg_d_hybrid_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Hybrid Decoupled aggregation"
|
||||
end function amg_d_hybrid_aggregator_fmt
|
||||
|
||||
|
||||
end module amg_d_hybrid_aggregator_mod
|
||||
@@ -79,9 +79,9 @@ module amg_d_invk_solver
|
||||
import :: psb_desc_type, psb_dspmat_type, psb_d_base_sparse_mat, &
|
||||
& amg_d_base_solver_type, psb_dpk_, amg_d_invk_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_d_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_d_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_invk_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -79,9 +79,9 @@ module amg_d_invt_solver
|
||||
import :: psb_desc_type, psb_dspmat_type, psb_d_base_sparse_mat, &
|
||||
& amg_d_base_solver_type, psb_dpk_, amg_d_invt_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_d_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_d_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_d_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_invt_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ module amg_d_jac_smoother
|
||||
subroutine amg_d_jac_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_d_jac_smoother_type, psb_dpk_, &
|
||||
& amg_d_base_smoother_type, psb_ipk_
|
||||
class(amg_d_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_d_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_d_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_d_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_jac_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -73,6 +73,22 @@ module amg_d_matchboxp_mod
|
||||
use iso_c_binding
|
||||
use psb_base_cbind_mod
|
||||
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
interface MatchingC
|
||||
subroutine dMatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate) bind(c,name='dMatching')
|
||||
use iso_c_binding
|
||||
import :: psb_c_ipk_, psb_c_lpk_
|
||||
implicit none
|
||||
|
||||
integer(psb_c_lpk_), value :: nlver,nledge
|
||||
integer(psb_c_lpk_) :: verlocptr(*),verlocind(*), verdistance(*)
|
||||
integer(psb_c_lpk_) :: mate(*)
|
||||
real(c_double) :: edgelocweight(*)
|
||||
end subroutine dMatchingC
|
||||
end interface MatchingC
|
||||
|
||||
#else
|
||||
interface MatchBoxPC
|
||||
subroutine dMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, myrank, numprocs, icomm,&
|
||||
@@ -93,7 +109,7 @@ module amg_d_matchboxp_mod
|
||||
real(c_double) :: msgpercent(*)
|
||||
end subroutine dMatchBoxPC
|
||||
end interface MatchBoxPC
|
||||
|
||||
#endif
|
||||
interface amg_i_aggr_assign
|
||||
module procedure amg_i_d_aggr_assign
|
||||
end interface amg_i_aggr_assign
|
||||
@@ -145,7 +161,7 @@ contains
|
||||
logical, parameter :: dump=.false., debug=.false., dump_mate=.false., &
|
||||
& debug_ilaggr=.false., debug_sync=.false., debug_mate=.false.
|
||||
integer(psb_ipk_), save :: idx_bldmtc=-1, idx_phase1=-1, idx_phase2=-1, idx_phase3=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
integer, parameter :: ilaggr_neginit=-1, ilaggr_nonlocal=-2
|
||||
|
||||
ictxt = desc_a%get_ctxt()
|
||||
@@ -608,7 +624,7 @@ contains
|
||||
logical, parameter :: old_style=.false., sort_minp=.true.
|
||||
character(len=40) :: name='build_matching', fname
|
||||
integer(psb_ipk_), save :: idx_cmboxp=-1, idx_bldahat=-1, idx_phase2=-1, idx_phase3=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
ictxt = desc_a%get_ctxt()
|
||||
call psb_info(ictxt,iam,np)
|
||||
@@ -810,7 +826,7 @@ contains
|
||||
character(len=80) :: aname
|
||||
real(psb_dpk_), parameter :: eps=epsilon(1.d0)
|
||||
integer(psb_ipk_), save :: idx_glbt=-1, idx_phase1=-1, idx_phase2=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
logical, parameter :: debug_symmetry = .false., check_size=.false.
|
||||
logical, parameter :: unroll_logtrans=.false.
|
||||
|
||||
@@ -863,7 +879,7 @@ contains
|
||||
nr = tcoo1%get_nrows()
|
||||
nc = tcoo1%get_ncols()
|
||||
nz = tcoo1%get_nzeros()
|
||||
call tcoo2%allocate(nr,nc,int(1.25*nz))
|
||||
call tcoo2%allocate(nr,nc,int(1.25*nz,psb_ipk_))
|
||||
k2 = 0
|
||||
!
|
||||
! Build the entries of \^A for matching
|
||||
@@ -1040,7 +1056,8 @@ contains
|
||||
integer(psb_c_lpk_) :: ph1_card(*),ph2_card(*)
|
||||
real(c_double) :: edgelocweight(:)
|
||||
real(c_double) :: msgpercent(*)
|
||||
integer(psb_ipk_) :: info, me, np
|
||||
integer(psb_ipk_) :: info
|
||||
integer(psb_mpk_) :: me, np
|
||||
integer(psb_c_mpk_) :: icomm, mrank, mnp
|
||||
logical, optional :: display_inp
|
||||
!
|
||||
@@ -1129,11 +1146,15 @@ contains
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*)' Calling MatchBoxP '
|
||||
end if
|
||||
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
call MatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate)
|
||||
#else
|
||||
call MatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, mrank, mnp, icomm,&
|
||||
& msgindsent,msgactualsent,msgpercent,&
|
||||
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card)
|
||||
#endif
|
||||
verlocptr(:) = verlocptr(:) + 1
|
||||
verlocind(:) = verlocind(:) + 1
|
||||
verdistance(:) = verdistance(:) + 1
|
||||
@@ -52,10 +52,10 @@
|
||||
!
|
||||
module amg_d_mumps_solver
|
||||
use amg_d_base_solver_mod
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
|
||||
use dmumps_struc_def
|
||||
#endif
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
|
||||
include 'dmumps_struc.h'
|
||||
#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ module amg_d_mumps_solver
|
||||
end type amg_d_mumps_rcntl_item
|
||||
|
||||
type, extends(amg_d_base_solver_type) :: amg_d_mumps_solver_type
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
type(dmumps_struc), allocatable :: id
|
||||
#else
|
||||
integer, allocatable :: id
|
||||
@@ -189,7 +189,7 @@ contains
|
||||
|
||||
info = 0
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
@@ -239,7 +239,7 @@ contains
|
||||
character(len=20) :: name='d_mumps_solver_clear_data'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
if (allocated(sv%id)) then
|
||||
if (sv%built) then
|
||||
@@ -279,7 +279,7 @@ contains
|
||||
character(len=20) :: name='d_mumps_solver_free'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
call sv%clear_data(info)
|
||||
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
|
||||
@@ -383,7 +383,7 @@ subroutine d_mumps_solver_csetc(sv,what,val,info,idx)
|
||||
|
||||
|
||||
select case(psb_toupper(trim(what)))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
|
||||
#endif
|
||||
@@ -421,7 +421,7 @@ subroutine d_mumps_solver_cseti(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = val
|
||||
case('MUMPS_PRINT_ERR')
|
||||
@@ -467,7 +467,7 @@ subroutine d_mumps_solver_csetr(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_RPAR_ENTRY')
|
||||
if(present(idx)) then
|
||||
! Note: this will allocate %item
|
||||
@@ -504,7 +504,7 @@ subroutine d_mumps_solver_default(sv)
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
if (.not.allocated(sv%id)) then
|
||||
allocate(sv%id,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
@@ -561,7 +561,7 @@ function d_mumps_solver_sizeof(sv) result(val)
|
||||
class(amg_d_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_epk_) :: val
|
||||
integer :: i
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
|
||||
#else
|
||||
val = 0
|
||||
|
||||
@@ -119,10 +119,6 @@
|
||||
module amg_d_parmatch_aggregator_mod
|
||||
use amg_d_base_aggregator_mod
|
||||
use amg_d_matchboxp_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
type, extends(amg_d_base_aggregator_type) :: amg_d_parmatch_aggregator_type
|
||||
end type amg_d_parmatch_aggregator_type
|
||||
#else
|
||||
type, extends(amg_d_base_aggregator_type) :: amg_d_parmatch_aggregator_type
|
||||
integer(psb_ipk_) :: matching_alg
|
||||
integer(psb_ipk_) :: n_sweeps ! When n_sweeps >1 we need an auxiliary descriptor
|
||||
@@ -400,6 +396,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
@@ -451,6 +448,7 @@ contains
|
||||
class(amg_d_base_aggregator_type), target, intent(inout) :: agnext
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
!
|
||||
select type(agnext)
|
||||
@@ -590,7 +588,7 @@ contains
|
||||
class(amg_d_parmatch_aggregator_type), intent(inout) :: ag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = 0
|
||||
info = psb_success_
|
||||
if ((info == 0).and.allocated(ag%w)) deallocate(ag%w,stat=info)
|
||||
if ((info == 0).and.allocated(ag%w_nxt)) deallocate(ag%w_nxt,stat=info)
|
||||
if ((info == 0).and.allocated(ag%prol)) then
|
||||
@@ -629,7 +627,7 @@ contains
|
||||
class(amg_d_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = 0
|
||||
info = psb_success_
|
||||
if (allocated(agnext)) then
|
||||
call agnext%free(info)
|
||||
if (info == 0) deallocate(agnext,stat=info)
|
||||
@@ -658,6 +656,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='d_parmatch_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
@@ -675,11 +674,6 @@ contains
|
||||
map = psb_linmap(psb_map_gen_linear_,desc_a,&
|
||||
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||
end if
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -687,5 +681,4 @@ contains
|
||||
|
||||
return
|
||||
end subroutine amg_d_parmatch_aggregator_bld_map
|
||||
#endif
|
||||
end module amg_d_parmatch_aggregator_mod
|
||||
|
||||
@@ -192,8 +192,8 @@ module amg_d_poly_smoother
|
||||
subroutine amg_d_poly_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_d_poly_smoother_type, psb_dpk_, &
|
||||
& amg_d_base_smoother_type, psb_ipk_
|
||||
class(amg_d_poly_smoother_type), intent(inout) :: sm
|
||||
class(amg_d_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_d_poly_smoother_type), intent(inout) :: sm
|
||||
class(amg_d_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_d_poly_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -113,6 +113,7 @@ module amg_d_prec_type
|
||||
procedure, pass(prec) :: free => amg_d_prec_free
|
||||
procedure, pass(prec) :: allocate_wrk => amg_d_allocate_wrk
|
||||
procedure, pass(prec) :: free_wrk => amg_d_free_wrk
|
||||
procedure, pass(prec) :: deallocate_wrk => amg_d_free_wrk
|
||||
procedure, pass(prec) :: is_allocated_wrk => amg_d_is_allocated_wrk
|
||||
procedure, pass(prec) :: get_complexity => amg_d_get_compl
|
||||
procedure, pass(prec) :: cmp_complexity => amg_d_cmp_compl
|
||||
|
||||
+262
-206
@@ -51,7 +51,7 @@ module amg_d_slu_solver
|
||||
use iso_c_binding
|
||||
use amg_d_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_d_base_solver_type) :: amg_d_slu_solver_type
|
||||
|
||||
@@ -63,9 +63,9 @@ module amg_d_slu_solver
|
||||
type(c_ptr) :: lufactors=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => d_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => d_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => d_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_d_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_d_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_d_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: free => d_slu_solver_free
|
||||
procedure, pass(sv) :: clear_data => d_slu_solver_clear_data
|
||||
procedure, pass(sv) :: descr => d_slu_solver_descr
|
||||
@@ -76,9 +76,8 @@ module amg_d_slu_solver
|
||||
end type amg_d_slu_solver_type
|
||||
|
||||
|
||||
private :: d_slu_solver_bld, d_slu_solver_apply, &
|
||||
& d_slu_solver_free, d_slu_solver_descr, &
|
||||
& d_slu_solver_sizeof, d_slu_solver_apply_vect, &
|
||||
private :: d_slu_solver_free, d_slu_solver_descr, &
|
||||
& d_slu_solver_sizeof, &
|
||||
& d_slu_solver_get_fmt, d_slu_solver_get_id, &
|
||||
& d_slu_solver_clear_data
|
||||
private :: d_slu_solver_finalize
|
||||
@@ -118,207 +117,264 @@ module amg_d_slu_solver
|
||||
end function amg_dslu_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_d_slu_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_d_slu_solver_bld
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_d_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
type(psb_d_vect_type),intent(inout) :: y
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_d_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_d_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_d_slu_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_d_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
real(psb_dpk_),intent(inout) :: y(:)
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_d_slu_solver_apply
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine d_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
real(psb_dpk_),intent(inout) :: y(:)
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
real(psb_dpk_), pointer :: ww(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='d_slu_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='real(psb_dpk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
ww(1:n_row) = x(1:n_row)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_dslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('T')
|
||||
info = amg_dslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('C')
|
||||
info = amg_dslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_, &
|
||||
& name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) &
|
||||
& call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,&
|
||||
& name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine d_slu_solver_apply
|
||||
|
||||
subroutine d_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
type(psb_d_vect_type),intent(inout) :: y
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_d_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_d_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='d_slu_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine d_slu_solver_apply_vect
|
||||
|
||||
subroutine d_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_dspmat_type) :: atmp
|
||||
type(psb_d_csc_sparse_mat) :: acsc
|
||||
type(psb_d_coo_sparse_mat) :: acoo
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='d_slu_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
nrow_a = atmp%get_nrows()
|
||||
call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
call acsc%mv_from_coo(acoo,info)
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entries to call C-base SuperLU
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_dslu_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%icp,acsc%ia,sv%lufactors)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_dslu_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine d_slu_solver_bld
|
||||
!!$ subroutine d_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
!!$ real(psb_dpk_),intent(inout) :: x(:)
|
||||
!!$ real(psb_dpk_),intent(inout) :: y(:)
|
||||
!!$ real(psb_dpk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
!!$
|
||||
!!$ integer :: n_row,n_col
|
||||
!!$ real(psb_dpk_), pointer :: ww(:)
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act
|
||||
!!$ character :: trans_
|
||||
!!$ character(len=20) :: name='d_slu_solver_apply'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$
|
||||
!!$ trans_ = psb_toupper(trans)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ case('T','C')
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ n_row = desc_data%get_local_rows()
|
||||
!!$ n_col = desc_data%get_local_cols()
|
||||
!!$
|
||||
!!$ if (n_col <= size(work)) then
|
||||
!!$ ww => work(1:n_col)
|
||||
!!$ else
|
||||
!!$ allocate(ww(n_col),stat=info)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_alloc_request_
|
||||
!!$ call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
!!$ & a_err='real(psb_dpk_)')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ ww(1:n_row) = x(1:n_row)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ info = amg_dslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('T')
|
||||
!!$ info = amg_dslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('C')
|
||||
!!$ info = amg_dslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_internal_error_, &
|
||||
!!$ & name,a_err='Invalid TRANS in ILU subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,&
|
||||
!!$ & name,a_err='Error in subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ if (n_col > size(work)) then
|
||||
!!$ deallocate(ww)
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine d_slu_solver_apply
|
||||
!!$
|
||||
!!$ subroutine d_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,wv,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
!!$ type(psb_d_vect_type),intent(inout) :: x
|
||||
!!$ type(psb_d_vect_type),intent(inout) :: y
|
||||
!!$ real(psb_dpk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
!!$ type(psb_d_vect_type),intent(inout) :: wv(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ type(psb_d_vect_type),intent(inout), optional :: initu
|
||||
!!$
|
||||
!!$ integer :: err_act
|
||||
!!$ character(len=20) :: name='d_slu_solver_apply_vect'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ call x%v%sync()
|
||||
!!$ call y%v%sync()
|
||||
!!$ call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
!!$ call y%v%set_host()
|
||||
!!$ if (info /= 0) goto 9999
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine d_slu_solver_apply_vect
|
||||
!!$
|
||||
!!$ subroutine d_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
!!$
|
||||
!!$ use psb_base_mod
|
||||
!!$
|
||||
!!$ Implicit None
|
||||
!!$
|
||||
!!$ ! Arguments
|
||||
!!$ type(psb_dspmat_type), intent(in), target :: a
|
||||
!!$ Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
!!$ class(amg_d_slu_solver_type), intent(inout) :: sv
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
!!$ class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
!!$ class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
!!$ class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
!!$ ! Local variables
|
||||
!!$ type(psb_dspmat_type) :: atmp
|
||||
!!$ type(psb_d_csc_sparse_mat) :: acsc
|
||||
!!$ type(psb_d_coo_sparse_mat) :: acoo
|
||||
!!$ integer :: n_row,n_col, nrow_a, nztota
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
!!$ character(len=20) :: name='d_slu_solver_bld', ch_err
|
||||
!!$
|
||||
!!$ info=psb_success_
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$ debug_unit = psb_get_debug_unit()
|
||||
!!$ debug_level = psb_get_debug_level()
|
||||
!!$ ctxt = desc_a%get_context()
|
||||
!!$ call psb_info(ctxt, me, np)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' start'
|
||||
!!$
|
||||
!!$
|
||||
!!$ n_row = desc_a%get_local_rows()
|
||||
!!$ n_col = desc_a%get_local_cols()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call a%cscnv(atmp,info,type='coo')
|
||||
!!$ call psb_rwextd(n_row,atmp,info,b=b)
|
||||
!!$ call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$ nrow_a = atmp%get_nrows()
|
||||
!!$ call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
!!$ call acsc%mv_from_coo(acoo,info)
|
||||
!!$ nztota = acsc%get_nzeros()
|
||||
!!$ ! Fix the entries to call C-base SuperLU
|
||||
!!$ acsc%ia(:) = acsc%ia(:) - 1
|
||||
!!$ acsc%icp(:) = acsc%icp(:) - 1
|
||||
!!$ info = amg_dslu_fact(nrow_a,nztota,acsc%val,&
|
||||
!!$ & acsc%icp,acsc%ia,sv%lufactors)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_from_subroutine_
|
||||
!!$ ch_err='amg_dslu_fact'
|
||||
!!$ call psb_errpush(info,name,a_err=ch_err)
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call acsc%free()
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' end'
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$ end subroutine d_slu_solver_bld
|
||||
|
||||
subroutine d_slu_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ module amg_d_sludist_solver
|
||||
use iso_c_binding
|
||||
use amg_d_base_solver_mod
|
||||
|
||||
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
|
||||
#if (!defined(AMG_HAVE_SLUDIST)) || defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_d_base_solver_type) :: amg_d_sludist_solver_type
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ contains
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
+63
-207
@@ -51,7 +51,7 @@ module amg_d_umf_solver
|
||||
use iso_c_binding
|
||||
use amg_d_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
type, extends(amg_d_base_solver_type) :: amg_d_umf_solver_type
|
||||
|
||||
end type amg_d_umf_solver_type
|
||||
@@ -62,9 +62,9 @@ module amg_d_umf_solver
|
||||
type(c_ptr) :: symbolic=c_null_ptr, numeric=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => d_umf_solver_bld
|
||||
procedure, pass(sv) :: apply_a => d_umf_solver_apply
|
||||
procedure, pass(sv) :: apply_v => d_umf_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_d_umf_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_d_umf_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_d_umf_solver_apply_vect
|
||||
procedure, pass(sv) :: free => d_umf_solver_free
|
||||
procedure, pass(sv) :: clear_data => d_umf_solver_clear_data
|
||||
procedure, pass(sv) :: descr => d_umf_solver_descr
|
||||
@@ -75,9 +75,8 @@ module amg_d_umf_solver
|
||||
end type amg_d_umf_solver_type
|
||||
|
||||
|
||||
private :: d_umf_solver_bld, d_umf_solver_apply, &
|
||||
& d_umf_solver_free, d_umf_solver_descr, &
|
||||
& d_umf_solver_sizeof, d_umf_solver_apply_vect, &
|
||||
private :: d_umf_solver_free, d_umf_solver_descr, &
|
||||
& d_umf_solver_sizeof, &
|
||||
& d_umf_solver_get_fmt, d_umf_solver_get_id, &
|
||||
& d_umf_solver_clear_data
|
||||
private :: d_umf_solver_finalize
|
||||
@@ -118,208 +117,65 @@ module amg_d_umf_solver
|
||||
end function amg_dumf_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_umf_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_d_umf_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
real(psb_dpk_),intent(inout) :: y(:)
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_d_umf_solver_apply
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_umf_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_d_umf_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
type(psb_d_vect_type),intent(inout) :: y
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_d_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_d_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_d_umf_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_d_umf_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_d_umf_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_d_umf_solver_bld
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine d_umf_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
real(psb_dpk_),intent(inout) :: x(:)
|
||||
real(psb_dpk_),intent(inout) :: y(:)
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
real(psb_dpk_), pointer :: ww(:)
|
||||
integer(psb_ipk_) :: i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='d_umf_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='real(psb_dpk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_dumf_solve(0,n_row,ww,x,n_row,sv%numeric)
|
||||
case('T')
|
||||
!
|
||||
! Note: with UMF, 1 meand Ctranspose, 2 means transpose
|
||||
! even for complex data.
|
||||
!
|
||||
if (psb_d_is_complex_) then
|
||||
info = amg_dumf_solve(2,n_row,ww,x,n_row,sv%numeric)
|
||||
else
|
||||
info = amg_dumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
||||
end if
|
||||
case('C')
|
||||
info = amg_dumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine d_umf_solver_apply
|
||||
|
||||
subroutine d_umf_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
type(psb_d_vect_type),intent(inout) :: x
|
||||
type(psb_d_vect_type),intent(inout) :: y
|
||||
real(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_d_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_d_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='d_umf_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine d_umf_solver_apply_vect
|
||||
|
||||
subroutine d_umf_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_dspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_d_umf_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_dspmat_type), intent(in), target, optional :: b
|
||||
class(psb_d_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_d_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_dspmat_type) :: atmp
|
||||
type(psb_d_csc_sparse_mat) :: acsc
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='d_umf_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='csc',dupl=psb_dupl_add_)
|
||||
call atmp%mv_to(acsc)
|
||||
nrow_a = acsc%get_nrows()
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entres to call C-base UMFPACK.
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_dumf_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%ia,acsc%icp,sv%symbolic,sv%numeric,&
|
||||
& sv%symbsize,sv%numsize)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_dumf_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine d_umf_solver_bld
|
||||
|
||||
subroutine d_umf_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -62,9 +62,6 @@ module amg_s_ainv_solver
|
||||
procedure, pass(sv) :: cseti => amg_s_ainv_solver_cseti
|
||||
procedure, pass(sv) :: csetc => amg_s_ainv_solver_csetc
|
||||
procedure, pass(sv) :: csetr => amg_s_ainv_solver_csetr
|
||||
!!$ procedure, pass(sv) :: seti => amg_s_ainv_solver_seti
|
||||
!!$ procedure, pass(sv) :: setc => amg_s_ainv_solver_setc
|
||||
!!$ procedure, pass(sv) :: setr => amg_s_ainv_solver_setr
|
||||
procedure, pass(sv) :: descr => amg_s_ainv_solver_descr
|
||||
procedure, pass(sv) :: default => s_ainv_solver_default
|
||||
procedure, nopass :: stringval => s_ainv_stringval
|
||||
@@ -91,9 +88,9 @@ module amg_s_ainv_solver
|
||||
import :: psb_desc_type, psb_sspmat_type, psb_s_base_sparse_mat, &
|
||||
& amg_s_base_solver_type, psb_dpk_, amg_s_ainv_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_s_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_s_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_ainv_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
! Do nothing
|
||||
|
||||
info = psb_success_
|
||||
return
|
||||
end subroutine amg_s_base_aggregator_set_aggr_type
|
||||
|
||||
@@ -486,6 +486,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='s_base_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
|
||||
@@ -150,7 +150,7 @@ contains
|
||||
class(amg_s_dec_aggregator_type), intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
select case(parms%aggr_type)
|
||||
case (amg_noalg_)
|
||||
ag%soc_map_bld => null()
|
||||
@@ -192,6 +192,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
!
|
||||
!
|
||||
! AMG4PSBLAS version 1.0
|
||||
! Algebraic Multigrid Package
|
||||
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||
!
|
||||
! (C) Copyright 2020
|
||||
!
|
||||
! Salvatore Filippone
|
||||
! Pasqua D'Ambra
|
||||
! Fabio Durastante
|
||||
!
|
||||
! Redistribution and use in source and binary forms, with or without
|
||||
! modification, are permitted provided that the following conditions
|
||||
! are met:
|
||||
! 1. Redistributions of source code must retain the above copyright
|
||||
! notice, this list of conditions and the following disclaimer.
|
||||
! 2. Redistributions in binary form must reproduce the above copyright
|
||||
! notice, this list of conditions, and the following disclaimer in the
|
||||
! documentation and/or other materials provided with the distribution.
|
||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
! not be used to endorse or promote products derived from this
|
||||
! software without specific written permission.
|
||||
!
|
||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
! The aggregator object hosts the aggregation method for building
|
||||
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||
! presented in
|
||||
!
|
||||
! S. Gratton, P. Henon, P. Jiranek and X. Vasseur:
|
||||
! Reducing complexity of algebraic multigrid by aggregation
|
||||
! Numerical Lin. Algebra with Applications, 2016, 23:501-518
|
||||
!
|
||||
module amg_s_hybrid_aggregator_mod
|
||||
|
||||
use amg_s_dec_aggregator_mod
|
||||
!
|
||||
! sm - class(amg_T_base_smoother_type), allocatable
|
||||
! The current level preconditioner (aka smoother).
|
||||
! parms - type(amg_RTml_parms)
|
||||
! The parameters defining the multilevel strategy.
|
||||
! ac - The local part of the current-level matrix, built by
|
||||
! coarsening the previous-level matrix.
|
||||
! desc_ac - type(psb_desc_type).
|
||||
! The communication descriptor associated to the matrix
|
||||
! stored in ac.
|
||||
! base_a - type(psb_Tspmat_type), pointer.
|
||||
! Pointer (really a pointer!) to the local part of the current
|
||||
! matrix (so we have a unified treatment of residuals).
|
||||
! We need this to avoid passing explicitly the current matrix
|
||||
! to the routine which applies the preconditioner.
|
||||
! base_desc - type(psb_desc_type), pointer.
|
||||
! Pointer to the communication descriptor associated to the
|
||||
! matrix pointed by base_a.
|
||||
! map - Stores the maps (restriction and prolongation) between the
|
||||
! vector spaces associated to the index spaces of the previous
|
||||
! and current levels.
|
||||
!
|
||||
! Methods:
|
||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||
! is appropriate for the current object, then call the corresponding method for
|
||||
! the contained object.
|
||||
! As an example: the descr() method prints out a description of the
|
||||
! level. It starts by invoking the descr() method of the parms object,
|
||||
! then calls the descr() method of the smoother object.
|
||||
!
|
||||
! descr - Prints a description of the object.
|
||||
! default - Set default values
|
||||
! dump - Dump to file object contents
|
||||
! set - Sets various parameters; when a request is unknown
|
||||
! it is passed to the smoother object for further processing.
|
||||
! check - Sanity checks.
|
||||
! sizeof - Total memory occupation in bytes
|
||||
! get_nzeros - Number of nonzeros
|
||||
!
|
||||
!
|
||||
type, extends(amg_s_dec_aggregator_type) :: amg_s_hybrid_aggregator_type
|
||||
|
||||
contains
|
||||
procedure, pass(ag) :: bld_tprol => amg_s_hybrid_aggregator_build_tprol
|
||||
procedure, nopass :: fmt => amg_s_hybrid_aggregator_fmt
|
||||
end type amg_s_hybrid_aggregator_type
|
||||
|
||||
|
||||
interface
|
||||
subroutine amg_s_hybrid_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
import :: amg_s_hybrid_aggregator_type, psb_desc_type, psb_sspmat_type, psb_spk_, &
|
||||
& psb_ipk_, psb_long_int_k_, amg_sml_parms
|
||||
implicit none
|
||||
class(amg_s_hybrid_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
type(psb_sspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_sspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_hybrid_aggregator_build_tprol
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
|
||||
function amg_s_hybrid_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Hybrid Decoupled aggregation"
|
||||
end function amg_s_hybrid_aggregator_fmt
|
||||
|
||||
|
||||
end module amg_s_hybrid_aggregator_mod
|
||||
@@ -79,9 +79,9 @@ module amg_s_invk_solver
|
||||
import :: psb_desc_type, psb_sspmat_type, psb_s_base_sparse_mat, &
|
||||
& amg_s_base_solver_type, psb_spk_, amg_s_invk_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_s_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_s_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_invk_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -79,9 +79,9 @@ module amg_s_invt_solver
|
||||
import :: psb_desc_type, psb_sspmat_type, psb_s_base_sparse_mat, &
|
||||
& amg_s_base_solver_type, psb_spk_, amg_s_invt_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_s_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_s_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_s_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_invt_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ module amg_s_jac_smoother
|
||||
subroutine amg_s_jac_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_s_jac_smoother_type, psb_spk_, &
|
||||
& amg_s_base_smoother_type, psb_ipk_
|
||||
class(amg_s_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_s_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_s_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_s_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_jac_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -73,6 +73,22 @@ module amg_s_matchboxp_mod
|
||||
use iso_c_binding
|
||||
use psb_base_cbind_mod
|
||||
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
interface MatchingC
|
||||
subroutine sMatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate) bind(c,name='sMatching')
|
||||
use iso_c_binding
|
||||
import :: psb_c_ipk_, psb_c_lpk_
|
||||
implicit none
|
||||
|
||||
integer(psb_c_lpk_), value :: nlver,nledge
|
||||
integer(psb_c_lpk_) :: verlocptr(*),verlocind(*), verdistance(*)
|
||||
integer(psb_c_lpk_) :: mate(*)
|
||||
real(c_float) :: edgelocweight(*)
|
||||
end subroutine sMatchingC
|
||||
end interface MatchingC
|
||||
|
||||
#else
|
||||
interface MatchBoxPC
|
||||
subroutine sMatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, myrank, numprocs, icomm,&
|
||||
@@ -93,7 +109,7 @@ module amg_s_matchboxp_mod
|
||||
real(c_double) :: msgpercent(*)
|
||||
end subroutine sMatchBoxPC
|
||||
end interface MatchBoxPC
|
||||
|
||||
#endif
|
||||
interface amg_i_aggr_assign
|
||||
module procedure amg_i_s_aggr_assign
|
||||
end interface amg_i_aggr_assign
|
||||
@@ -145,7 +161,7 @@ contains
|
||||
logical, parameter :: dump=.false., debug=.false., dump_mate=.false., &
|
||||
& debug_ilaggr=.false., debug_sync=.false., debug_mate=.false.
|
||||
integer(psb_ipk_), save :: idx_bldmtc=-1, idx_phase1=-1, idx_phase2=-1, idx_phase3=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
integer, parameter :: ilaggr_neginit=-1, ilaggr_nonlocal=-2
|
||||
|
||||
ictxt = desc_a%get_ctxt()
|
||||
@@ -608,7 +624,7 @@ contains
|
||||
logical, parameter :: old_style=.false., sort_minp=.true.
|
||||
character(len=40) :: name='build_matching', fname
|
||||
integer(psb_ipk_), save :: idx_cmboxp=-1, idx_bldahat=-1, idx_phase2=-1, idx_phase3=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
ictxt = desc_a%get_ctxt()
|
||||
call psb_info(ictxt,iam,np)
|
||||
@@ -810,7 +826,7 @@ contains
|
||||
character(len=80) :: aname
|
||||
real(psb_spk_), parameter :: eps=epsilon(1.d0)
|
||||
integer(psb_ipk_), save :: idx_glbt=-1, idx_phase1=-1, idx_phase2=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
logical, parameter :: debug_symmetry = .false., check_size=.false.
|
||||
logical, parameter :: unroll_logtrans=.false.
|
||||
|
||||
@@ -863,7 +879,7 @@ contains
|
||||
nr = tcoo1%get_nrows()
|
||||
nc = tcoo1%get_ncols()
|
||||
nz = tcoo1%get_nzeros()
|
||||
call tcoo2%allocate(nr,nc,int(1.25*nz))
|
||||
call tcoo2%allocate(nr,nc,int(1.25*nz,psb_ipk_))
|
||||
k2 = 0
|
||||
!
|
||||
! Build the entries of \^A for matching
|
||||
@@ -1040,7 +1056,8 @@ contains
|
||||
integer(psb_c_lpk_) :: ph1_card(*),ph2_card(*)
|
||||
real(c_float) :: edgelocweight(:)
|
||||
real(c_double) :: msgpercent(*)
|
||||
integer(psb_ipk_) :: info, me, np
|
||||
integer(psb_ipk_) :: info
|
||||
integer(psb_mpk_) :: me, np
|
||||
integer(psb_c_mpk_) :: icomm, mrank, mnp
|
||||
logical, optional :: display_inp
|
||||
!
|
||||
@@ -1129,11 +1146,15 @@ contains
|
||||
call psb_barrier(ictxt)
|
||||
if (me == 0) write(0,*)' Calling MatchBoxP '
|
||||
end if
|
||||
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
call MatchingC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate)
|
||||
#else
|
||||
call MatchBoxPC(nlver,nledge,verlocptr,verlocind,edgelocweight,&
|
||||
& verdistance, mate, mrank, mnp, icomm,&
|
||||
& msgindsent,msgactualsent,msgpercent,&
|
||||
& ph0_time, ph1_time, ph2_time, ph1_card, ph2_card)
|
||||
#endif
|
||||
verlocptr(:) = verlocptr(:) + 1
|
||||
verlocind(:) = verlocind(:) + 1
|
||||
verdistance(:) = verdistance(:) + 1
|
||||
@@ -52,10 +52,10 @@
|
||||
!
|
||||
module amg_s_mumps_solver
|
||||
use amg_s_base_solver_mod
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
|
||||
use smumps_struc_def
|
||||
#endif
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
|
||||
include 'smumps_struc.h'
|
||||
#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ module amg_s_mumps_solver
|
||||
end type amg_s_mumps_rcntl_item
|
||||
|
||||
type, extends(amg_s_base_solver_type) :: amg_s_mumps_solver_type
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
type(smumps_struc), allocatable :: id
|
||||
#else
|
||||
integer, allocatable :: id
|
||||
@@ -189,7 +189,7 @@ contains
|
||||
|
||||
info = 0
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
@@ -239,7 +239,7 @@ contains
|
||||
character(len=20) :: name='s_mumps_solver_clear_data'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
if (allocated(sv%id)) then
|
||||
if (sv%built) then
|
||||
@@ -279,7 +279,7 @@ contains
|
||||
character(len=20) :: name='s_mumps_solver_free'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
call sv%clear_data(info)
|
||||
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
|
||||
@@ -383,7 +383,7 @@ subroutine s_mumps_solver_csetc(sv,what,val,info,idx)
|
||||
|
||||
|
||||
select case(psb_toupper(trim(what)))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
|
||||
#endif
|
||||
@@ -421,7 +421,7 @@ subroutine s_mumps_solver_cseti(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = val
|
||||
case('MUMPS_PRINT_ERR')
|
||||
@@ -467,7 +467,7 @@ subroutine s_mumps_solver_csetr(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_RPAR_ENTRY')
|
||||
if(present(idx)) then
|
||||
! Note: this will allocate %item
|
||||
@@ -504,7 +504,7 @@ subroutine s_mumps_solver_default(sv)
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
if (.not.allocated(sv%id)) then
|
||||
allocate(sv%id,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
@@ -561,7 +561,7 @@ function s_mumps_solver_sizeof(sv) result(val)
|
||||
class(amg_s_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_epk_) :: val
|
||||
integer :: i
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
|
||||
#else
|
||||
val = 0
|
||||
|
||||
@@ -119,10 +119,6 @@
|
||||
module amg_s_parmatch_aggregator_mod
|
||||
use amg_s_base_aggregator_mod
|
||||
use amg_s_matchboxp_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
type, extends(amg_s_base_aggregator_type) :: amg_s_parmatch_aggregator_type
|
||||
end type amg_s_parmatch_aggregator_type
|
||||
#else
|
||||
type, extends(amg_s_base_aggregator_type) :: amg_s_parmatch_aggregator_type
|
||||
integer(psb_ipk_) :: matching_alg
|
||||
integer(psb_ipk_) :: n_sweeps ! When n_sweeps >1 we need an auxiliary descriptor
|
||||
@@ -400,6 +396,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
@@ -451,6 +448,7 @@ contains
|
||||
class(amg_s_base_aggregator_type), target, intent(inout) :: agnext
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
!
|
||||
select type(agnext)
|
||||
@@ -590,7 +588,7 @@ contains
|
||||
class(amg_s_parmatch_aggregator_type), intent(inout) :: ag
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = 0
|
||||
info = psb_success_
|
||||
if ((info == 0).and.allocated(ag%w)) deallocate(ag%w,stat=info)
|
||||
if ((info == 0).and.allocated(ag%w_nxt)) deallocate(ag%w_nxt,stat=info)
|
||||
if ((info == 0).and.allocated(ag%prol)) then
|
||||
@@ -629,7 +627,7 @@ contains
|
||||
class(amg_s_base_aggregator_type), allocatable, intent(inout) :: agnext
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = 0
|
||||
info = psb_success_
|
||||
if (allocated(agnext)) then
|
||||
call agnext%free(info)
|
||||
if (info == 0) deallocate(agnext,stat=info)
|
||||
@@ -658,6 +656,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='s_parmatch_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
@@ -675,11 +674,6 @@ contains
|
||||
map = psb_linmap(psb_map_gen_linear_,desc_a,&
|
||||
& desc_ac,op_restr,op_prol,ilaggr,nlaggr)
|
||||
end if
|
||||
if(info /= psb_success_) then
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='sp_Free')
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
@@ -687,5 +681,4 @@ contains
|
||||
|
||||
return
|
||||
end subroutine amg_s_parmatch_aggregator_bld_map
|
||||
#endif
|
||||
end module amg_s_parmatch_aggregator_mod
|
||||
|
||||
@@ -192,8 +192,8 @@ module amg_s_poly_smoother
|
||||
subroutine amg_s_poly_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_s_poly_smoother_type, psb_spk_, &
|
||||
& amg_s_base_smoother_type, psb_ipk_
|
||||
class(amg_s_poly_smoother_type), intent(inout) :: sm
|
||||
class(amg_s_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_s_poly_smoother_type), intent(inout) :: sm
|
||||
class(amg_s_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_s_poly_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -113,6 +113,7 @@ module amg_s_prec_type
|
||||
procedure, pass(prec) :: free => amg_s_prec_free
|
||||
procedure, pass(prec) :: allocate_wrk => amg_s_allocate_wrk
|
||||
procedure, pass(prec) :: free_wrk => amg_s_free_wrk
|
||||
procedure, pass(prec) :: deallocate_wrk => amg_s_free_wrk
|
||||
procedure, pass(prec) :: is_allocated_wrk => amg_s_is_allocated_wrk
|
||||
procedure, pass(prec) :: get_complexity => amg_s_get_compl
|
||||
procedure, pass(prec) :: cmp_complexity => amg_s_cmp_compl
|
||||
|
||||
+262
-206
@@ -51,7 +51,7 @@ module amg_s_slu_solver
|
||||
use iso_c_binding
|
||||
use amg_s_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_s_base_solver_type) :: amg_s_slu_solver_type
|
||||
|
||||
@@ -63,9 +63,9 @@ module amg_s_slu_solver
|
||||
type(c_ptr) :: lufactors=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => s_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => s_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => s_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_s_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_s_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_s_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: free => s_slu_solver_free
|
||||
procedure, pass(sv) :: clear_data => s_slu_solver_clear_data
|
||||
procedure, pass(sv) :: descr => s_slu_solver_descr
|
||||
@@ -76,9 +76,8 @@ module amg_s_slu_solver
|
||||
end type amg_s_slu_solver_type
|
||||
|
||||
|
||||
private :: s_slu_solver_bld, s_slu_solver_apply, &
|
||||
& s_slu_solver_free, s_slu_solver_descr, &
|
||||
& s_slu_solver_sizeof, s_slu_solver_apply_vect, &
|
||||
private :: s_slu_solver_free, s_slu_solver_descr, &
|
||||
& s_slu_solver_sizeof, &
|
||||
& s_slu_solver_get_fmt, s_slu_solver_get_id, &
|
||||
& s_slu_solver_clear_data
|
||||
private :: s_slu_solver_finalize
|
||||
@@ -118,207 +117,264 @@ module amg_s_slu_solver
|
||||
end function amg_sslu_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_s_slu_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_sspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_sspmat_type), intent(in), target, optional :: b
|
||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_s_slu_solver_bld
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_s_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_s_vect_type),intent(inout) :: x
|
||||
type(psb_s_vect_type),intent(inout) :: y
|
||||
real(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_spk_),target, intent(inout) :: work(:)
|
||||
type(psb_s_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_s_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_s_slu_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_s_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_s_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
real(psb_spk_),intent(inout) :: x(:)
|
||||
real(psb_spk_),intent(inout) :: y(:)
|
||||
real(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_spk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_spk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_s_slu_solver_apply
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine s_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
real(psb_spk_),intent(inout) :: x(:)
|
||||
real(psb_spk_),intent(inout) :: y(:)
|
||||
real(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_spk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
real(psb_spk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
real(psb_spk_), pointer :: ww(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='s_slu_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='real(psb_spk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
ww(1:n_row) = x(1:n_row)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_sslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('T')
|
||||
info = amg_sslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('C')
|
||||
info = amg_sslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_, &
|
||||
& name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) &
|
||||
& call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,&
|
||||
& name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine s_slu_solver_apply
|
||||
|
||||
subroutine s_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_s_vect_type),intent(inout) :: x
|
||||
type(psb_s_vect_type),intent(inout) :: y
|
||||
real(psb_spk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
real(psb_spk_),target, intent(inout) :: work(:)
|
||||
type(psb_s_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_s_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='s_slu_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine s_slu_solver_apply_vect
|
||||
|
||||
subroutine s_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_sspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_sspmat_type), intent(in), target, optional :: b
|
||||
class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_sspmat_type) :: atmp
|
||||
type(psb_s_csc_sparse_mat) :: acsc
|
||||
type(psb_s_coo_sparse_mat) :: acoo
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='s_slu_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
nrow_a = atmp%get_nrows()
|
||||
call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
call acsc%mv_from_coo(acoo,info)
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entries to call C-base SuperLU
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_sslu_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%icp,acsc%ia,sv%lufactors)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_sslu_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine s_slu_solver_bld
|
||||
!!$ subroutine s_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
!!$ real(psb_spk_),intent(inout) :: x(:)
|
||||
!!$ real(psb_spk_),intent(inout) :: y(:)
|
||||
!!$ real(psb_spk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ real(psb_spk_),target, intent(inout) :: work(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ real(psb_spk_),intent(inout), optional :: initu(:)
|
||||
!!$
|
||||
!!$ integer :: n_row,n_col
|
||||
!!$ real(psb_spk_), pointer :: ww(:)
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act
|
||||
!!$ character :: trans_
|
||||
!!$ character(len=20) :: name='s_slu_solver_apply'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$
|
||||
!!$ trans_ = psb_toupper(trans)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ case('T','C')
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ n_row = desc_data%get_local_rows()
|
||||
!!$ n_col = desc_data%get_local_cols()
|
||||
!!$
|
||||
!!$ if (n_col <= size(work)) then
|
||||
!!$ ww => work(1:n_col)
|
||||
!!$ else
|
||||
!!$ allocate(ww(n_col),stat=info)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_alloc_request_
|
||||
!!$ call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
!!$ & a_err='real(psb_spk_)')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ ww(1:n_row) = x(1:n_row)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ info = amg_sslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('T')
|
||||
!!$ info = amg_sslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('C')
|
||||
!!$ info = amg_sslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_internal_error_, &
|
||||
!!$ & name,a_err='Invalid TRANS in ILU subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,&
|
||||
!!$ & name,a_err='Error in subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ if (n_col > size(work)) then
|
||||
!!$ deallocate(ww)
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine s_slu_solver_apply
|
||||
!!$
|
||||
!!$ subroutine s_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,wv,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
!!$ type(psb_s_vect_type),intent(inout) :: x
|
||||
!!$ type(psb_s_vect_type),intent(inout) :: y
|
||||
!!$ real(psb_spk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ real(psb_spk_),target, intent(inout) :: work(:)
|
||||
!!$ type(psb_s_vect_type),intent(inout) :: wv(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ type(psb_s_vect_type),intent(inout), optional :: initu
|
||||
!!$
|
||||
!!$ integer :: err_act
|
||||
!!$ character(len=20) :: name='s_slu_solver_apply_vect'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ call x%v%sync()
|
||||
!!$ call y%v%sync()
|
||||
!!$ call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
!!$ call y%v%set_host()
|
||||
!!$ if (info /= 0) goto 9999
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine s_slu_solver_apply_vect
|
||||
!!$
|
||||
!!$ subroutine s_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
!!$
|
||||
!!$ use psb_base_mod
|
||||
!!$
|
||||
!!$ Implicit None
|
||||
!!$
|
||||
!!$ ! Arguments
|
||||
!!$ type(psb_sspmat_type), intent(in), target :: a
|
||||
!!$ Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
!!$ class(amg_s_slu_solver_type), intent(inout) :: sv
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ type(psb_sspmat_type), intent(in), target, optional :: b
|
||||
!!$ class(psb_s_base_sparse_mat), intent(in), optional :: amold
|
||||
!!$ class(psb_s_base_vect_type), intent(in), optional :: vmold
|
||||
!!$ class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
!!$ ! Local variables
|
||||
!!$ type(psb_sspmat_type) :: atmp
|
||||
!!$ type(psb_s_csc_sparse_mat) :: acsc
|
||||
!!$ type(psb_s_coo_sparse_mat) :: acoo
|
||||
!!$ integer :: n_row,n_col, nrow_a, nztota
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
!!$ character(len=20) :: name='s_slu_solver_bld', ch_err
|
||||
!!$
|
||||
!!$ info=psb_success_
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$ debug_unit = psb_get_debug_unit()
|
||||
!!$ debug_level = psb_get_debug_level()
|
||||
!!$ ctxt = desc_a%get_context()
|
||||
!!$ call psb_info(ctxt, me, np)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' start'
|
||||
!!$
|
||||
!!$
|
||||
!!$ n_row = desc_a%get_local_rows()
|
||||
!!$ n_col = desc_a%get_local_cols()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call a%cscnv(atmp,info,type='coo')
|
||||
!!$ call psb_rwextd(n_row,atmp,info,b=b)
|
||||
!!$ call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$ nrow_a = atmp%get_nrows()
|
||||
!!$ call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
!!$ call acsc%mv_from_coo(acoo,info)
|
||||
!!$ nztota = acsc%get_nzeros()
|
||||
!!$ ! Fix the entries to call C-base SuperLU
|
||||
!!$ acsc%ia(:) = acsc%ia(:) - 1
|
||||
!!$ acsc%icp(:) = acsc%icp(:) - 1
|
||||
!!$ info = amg_sslu_fact(nrow_a,nztota,acsc%val,&
|
||||
!!$ & acsc%icp,acsc%ia,sv%lufactors)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_from_subroutine_
|
||||
!!$ ch_err='amg_sslu_fact'
|
||||
!!$ call psb_errpush(info,name,a_err=ch_err)
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call acsc%free()
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' end'
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$ end subroutine s_slu_solver_bld
|
||||
|
||||
subroutine s_slu_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ contains
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -62,9 +62,6 @@ module amg_z_ainv_solver
|
||||
procedure, pass(sv) :: cseti => amg_z_ainv_solver_cseti
|
||||
procedure, pass(sv) :: csetc => amg_z_ainv_solver_csetc
|
||||
procedure, pass(sv) :: csetr => amg_z_ainv_solver_csetr
|
||||
!!$ procedure, pass(sv) :: seti => amg_z_ainv_solver_seti
|
||||
!!$ procedure, pass(sv) :: setc => amg_z_ainv_solver_setc
|
||||
!!$ procedure, pass(sv) :: setr => amg_z_ainv_solver_setr
|
||||
procedure, pass(sv) :: descr => amg_z_ainv_solver_descr
|
||||
procedure, pass(sv) :: default => z_ainv_solver_default
|
||||
procedure, nopass :: stringval => z_ainv_stringval
|
||||
@@ -91,9 +88,9 @@ module amg_z_ainv_solver
|
||||
import :: psb_desc_type, psb_zspmat_type, psb_z_base_sparse_mat, &
|
||||
& amg_z_base_solver_type, psb_dpk_, amg_z_ainv_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_z_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_z_ainv_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_z_ainv_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -302,7 +302,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
! Do nothing
|
||||
|
||||
info = psb_success_
|
||||
return
|
||||
end subroutine amg_z_base_aggregator_set_aggr_type
|
||||
|
||||
@@ -486,6 +486,7 @@ contains
|
||||
integer(psb_ipk_) :: err_act
|
||||
character(len=20) :: name='z_base_aggregator_bld_map'
|
||||
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
!
|
||||
! Copy the prolongation/restriction matrices into the descriptor map.
|
||||
|
||||
@@ -150,7 +150,7 @@ contains
|
||||
class(amg_z_dec_aggregator_type), intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(in) :: parms
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
|
||||
info = psb_success_
|
||||
select case(parms%aggr_type)
|
||||
case (amg_noalg_)
|
||||
ag%soc_map_bld => null()
|
||||
@@ -192,6 +192,7 @@ contains
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
character(1024) :: prefix_
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
!
|
||||
!
|
||||
! AMG4PSBLAS version 1.0
|
||||
! Algebraic Multigrid Package
|
||||
! based on PSBLAS (Parallel Sparse BLAS version 3.7)
|
||||
!
|
||||
! (C) Copyright 2020
|
||||
!
|
||||
! Salvatore Filippone
|
||||
! Pasqua D'Ambra
|
||||
! Fabio Durastante
|
||||
!
|
||||
! Redistribution and use in source and binary forms, with or without
|
||||
! modification, are permitted provided that the following conditions
|
||||
! are met:
|
||||
! 1. Redistributions of source code must retain the above copyright
|
||||
! notice, this list of conditions and the following disclaimer.
|
||||
! 2. Redistributions in binary form must reproduce the above copyright
|
||||
! notice, this list of conditions, and the following disclaimer in the
|
||||
! documentation and/or other materials provided with the distribution.
|
||||
! 3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
! not be used to endorse or promote products derived from this
|
||||
! software without specific written permission.
|
||||
!
|
||||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
! ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
! TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
! PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
! CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
! CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
! ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
! POSSIBILITY OF SUCH DAMAGE.
|
||||
!
|
||||
!
|
||||
!
|
||||
!
|
||||
! The aggregator object hosts the aggregation method for building
|
||||
! the multilevel hierarchy. This variant is based on the hybrid method
|
||||
! presented in
|
||||
!
|
||||
! S. Gratton, P. Henon, P. Jiranek and X. Vasseur:
|
||||
! Reducing complexity of algebraic multigrid by aggregation
|
||||
! Numerical Lin. Algebra with Applications, 2016, 23:501-518
|
||||
!
|
||||
module amg_z_hybrid_aggregator_mod
|
||||
|
||||
use amg_z_dec_aggregator_mod
|
||||
!
|
||||
! sm - class(amg_T_base_smoother_type), allocatable
|
||||
! The current level preconditioner (aka smoother).
|
||||
! parms - type(amg_RTml_parms)
|
||||
! The parameters defining the multilevel strategy.
|
||||
! ac - The local part of the current-level matrix, built by
|
||||
! coarsening the previous-level matrix.
|
||||
! desc_ac - type(psb_desc_type).
|
||||
! The communication descriptor associated to the matrix
|
||||
! stored in ac.
|
||||
! base_a - type(psb_Tspmat_type), pointer.
|
||||
! Pointer (really a pointer!) to the local part of the current
|
||||
! matrix (so we have a unified treatment of residuals).
|
||||
! We need this to avoid passing explicitly the current matrix
|
||||
! to the routine which applies the preconditioner.
|
||||
! base_desc - type(psb_desc_type), pointer.
|
||||
! Pointer to the communication descriptor associated to the
|
||||
! matrix pointed by base_a.
|
||||
! map - Stores the maps (restriction and prolongation) between the
|
||||
! vector spaces associated to the index spaces of the previous
|
||||
! and current levels.
|
||||
!
|
||||
! Methods:
|
||||
! Most methods follow the encapsulation hierarchy: they take whatever action
|
||||
! is appropriate for the current object, then call the corresponding method for
|
||||
! the contained object.
|
||||
! As an example: the descr() method prints out a description of the
|
||||
! level. It starts by invoking the descr() method of the parms object,
|
||||
! then calls the descr() method of the smoother object.
|
||||
!
|
||||
! descr - Prints a description of the object.
|
||||
! default - Set default values
|
||||
! dump - Dump to file object contents
|
||||
! set - Sets various parameters; when a request is unknown
|
||||
! it is passed to the smoother object for further processing.
|
||||
! check - Sanity checks.
|
||||
! sizeof - Total memory occupation in bytes
|
||||
! get_nzeros - Number of nonzeros
|
||||
!
|
||||
!
|
||||
type, extends(amg_z_dec_aggregator_type) :: amg_z_hybrid_aggregator_type
|
||||
|
||||
contains
|
||||
procedure, pass(ag) :: bld_tprol => amg_z_hybrid_aggregator_build_tprol
|
||||
procedure, nopass :: fmt => amg_z_hybrid_aggregator_fmt
|
||||
end type amg_z_hybrid_aggregator_type
|
||||
|
||||
|
||||
interface
|
||||
subroutine amg_z_hybrid_aggregator_build_tprol(ag,parms,a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
import :: amg_z_hybrid_aggregator_type, psb_desc_type, psb_zspmat_type, psb_dpk_, &
|
||||
& psb_ipk_, psb_long_int_k_, amg_dml_parms
|
||||
implicit none
|
||||
class(amg_z_hybrid_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
type(psb_zspmat_type), intent(in) :: a
|
||||
type(psb_desc_type), intent(in) :: desc_a
|
||||
integer(psb_ipk_), allocatable, intent(out) :: ilaggr(:),nlaggr(:)
|
||||
type(psb_zspmat_type), intent(out) :: op_prol
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_z_hybrid_aggregator_build_tprol
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
|
||||
function amg_z_hybrid_aggregator_fmt() result(val)
|
||||
implicit none
|
||||
character(len=32) :: val
|
||||
|
||||
val = "Hybrid Decoupled aggregation"
|
||||
end function amg_z_hybrid_aggregator_fmt
|
||||
|
||||
|
||||
end module amg_z_hybrid_aggregator_mod
|
||||
@@ -79,9 +79,9 @@ module amg_z_invk_solver
|
||||
import :: psb_desc_type, psb_zspmat_type, psb_z_base_sparse_mat, &
|
||||
& amg_z_base_solver_type, psb_dpk_, amg_z_invk_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_z_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_z_invk_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_z_invk_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -79,9 +79,9 @@ module amg_z_invt_solver
|
||||
import :: psb_desc_type, psb_zspmat_type, psb_z_base_sparse_mat, &
|
||||
& amg_z_base_solver_type, psb_dpk_, amg_z_invt_solver_type, psb_ipk_
|
||||
Implicit None
|
||||
class(amg_z_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), allocatable, intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
class(amg_z_invt_solver_type), intent(inout) :: sv
|
||||
class(amg_z_base_solver_type), intent(inout) :: svout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_z_invt_solver_clone_settings
|
||||
end interface
|
||||
|
||||
|
||||
@@ -203,8 +203,8 @@ module amg_z_jac_smoother
|
||||
subroutine amg_z_jac_smoother_clone_settings(sm,smout,info)
|
||||
import :: amg_z_jac_smoother_type, psb_dpk_, &
|
||||
& amg_z_base_smoother_type, psb_ipk_
|
||||
class(amg_z_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_z_base_smoother_type), allocatable, intent(inout) :: smout
|
||||
class(amg_z_jac_smoother_type), intent(inout) :: sm
|
||||
class(amg_z_base_smoother_type), intent(inout) :: smout
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
end subroutine amg_z_jac_smoother_clone_settings
|
||||
end interface
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
!
|
||||
module amg_z_mumps_solver
|
||||
use amg_z_base_solver_mod
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_MODULES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_MODULES)
|
||||
use zmumps_struc_def
|
||||
#endif
|
||||
#if defined(HAVE_MUMPS_) && defined(HAVE_MUMPS_INCLUDES_)
|
||||
#if defined(AMG_HAVE_MUMPS) && defined(AMG_HAVE_MUMPS_INCLUDES)
|
||||
include 'zmumps_struc.h'
|
||||
#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ module amg_z_mumps_solver
|
||||
end type amg_z_mumps_rcntl_item
|
||||
|
||||
type, extends(amg_z_base_solver_type) :: amg_z_mumps_solver_type
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
type(zmumps_struc), allocatable :: id
|
||||
#else
|
||||
integer, allocatable :: id
|
||||
@@ -189,7 +189,7 @@ contains
|
||||
|
||||
info = 0
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
@@ -239,7 +239,7 @@ contains
|
||||
character(len=20) :: name='z_mumps_solver_clear_data'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
if (allocated(sv%id)) then
|
||||
if (sv%built) then
|
||||
@@ -279,7 +279,7 @@ contains
|
||||
character(len=20) :: name='z_mumps_solver_free'
|
||||
|
||||
info = 0
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
call psb_erractionsave(err_act)
|
||||
call sv%clear_data(info)
|
||||
if ((info == 0).and.allocated(sv%icntl)) deallocate(sv%icntl,stat=info)
|
||||
@@ -383,7 +383,7 @@ subroutine z_mumps_solver_csetc(sv,what,val,info,idx)
|
||||
|
||||
|
||||
select case(psb_toupper(trim(what)))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = sv%stringval(psb_toupper(trim(val)))
|
||||
#endif
|
||||
@@ -421,7 +421,7 @@ subroutine z_mumps_solver_cseti(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_LOC_GLOB')
|
||||
sv%ipar(1) = val
|
||||
case('MUMPS_PRINT_ERR')
|
||||
@@ -467,7 +467,7 @@ subroutine z_mumps_solver_csetr(sv,what,val,info,idx)
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
select case(psb_toupper(what))
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
case('MUMPS_RPAR_ENTRY')
|
||||
if(present(idx)) then
|
||||
! Note: this will allocate %item
|
||||
@@ -504,7 +504,7 @@ subroutine z_mumps_solver_default(sv)
|
||||
info = psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
if (.not.allocated(sv%id)) then
|
||||
allocate(sv%id,stat=info)
|
||||
if (info /= psb_success_) then
|
||||
@@ -561,7 +561,7 @@ function z_mumps_solver_sizeof(sv) result(val)
|
||||
class(amg_z_mumps_solver_type), intent(in) :: sv
|
||||
integer(psb_epk_) :: val
|
||||
integer :: i
|
||||
#if defined(HAVE_MUMPS_)
|
||||
#if defined(AMG_HAVE_MUMPS)
|
||||
val = (sv%id%INFOG(22)+sv%id%INFOG(32))*1d+6
|
||||
#else
|
||||
val = 0
|
||||
|
||||
@@ -113,6 +113,7 @@ module amg_z_prec_type
|
||||
procedure, pass(prec) :: free => amg_z_prec_free
|
||||
procedure, pass(prec) :: allocate_wrk => amg_z_allocate_wrk
|
||||
procedure, pass(prec) :: free_wrk => amg_z_free_wrk
|
||||
procedure, pass(prec) :: deallocate_wrk => amg_z_free_wrk
|
||||
procedure, pass(prec) :: is_allocated_wrk => amg_z_is_allocated_wrk
|
||||
procedure, pass(prec) :: get_complexity => amg_z_get_compl
|
||||
procedure, pass(prec) :: cmp_complexity => amg_z_cmp_compl
|
||||
|
||||
+262
-206
@@ -51,7 +51,7 @@ module amg_z_slu_solver
|
||||
use iso_c_binding
|
||||
use amg_z_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_z_base_solver_type) :: amg_z_slu_solver_type
|
||||
|
||||
@@ -63,9 +63,9 @@ module amg_z_slu_solver
|
||||
type(c_ptr) :: lufactors=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => z_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => z_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => z_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_z_slu_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_z_slu_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_z_slu_solver_apply_vect
|
||||
procedure, pass(sv) :: free => z_slu_solver_free
|
||||
procedure, pass(sv) :: clear_data => z_slu_solver_clear_data
|
||||
procedure, pass(sv) :: descr => z_slu_solver_descr
|
||||
@@ -76,9 +76,8 @@ module amg_z_slu_solver
|
||||
end type amg_z_slu_solver_type
|
||||
|
||||
|
||||
private :: z_slu_solver_bld, z_slu_solver_apply, &
|
||||
& z_slu_solver_free, z_slu_solver_descr, &
|
||||
& z_slu_solver_sizeof, z_slu_solver_apply_vect, &
|
||||
private :: z_slu_solver_free, z_slu_solver_descr, &
|
||||
& z_slu_solver_sizeof, &
|
||||
& z_slu_solver_get_fmt, z_slu_solver_get_id, &
|
||||
& z_slu_solver_clear_data
|
||||
private :: z_slu_solver_finalize
|
||||
@@ -118,207 +117,264 @@ module amg_z_slu_solver
|
||||
end function amg_zslu_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_z_slu_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_z_slu_solver_bld
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_z_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
type(psb_z_vect_type),intent(inout) :: y
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_z_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_z_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_z_slu_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_z_slu_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
complex(psb_dpk_),intent(inout) :: y(:)
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_z_slu_solver_apply
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine z_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
complex(psb_dpk_),intent(inout) :: y(:)
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
complex(psb_dpk_), pointer :: ww(:)
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='z_slu_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='complex(psb_dpk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
ww(1:n_row) = x(1:n_row)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_zslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('T')
|
||||
info = amg_zslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
case('C')
|
||||
info = amg_zslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_, &
|
||||
& name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) &
|
||||
& call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,&
|
||||
& name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine z_slu_solver_apply
|
||||
|
||||
subroutine z_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
type(psb_z_vect_type),intent(inout) :: y
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_z_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_z_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='z_slu_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine z_slu_solver_apply_vect
|
||||
|
||||
subroutine z_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_zspmat_type) :: atmp
|
||||
type(psb_z_csc_sparse_mat) :: acsc
|
||||
type(psb_z_coo_sparse_mat) :: acoo
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='z_slu_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
nrow_a = atmp%get_nrows()
|
||||
call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
call acsc%mv_from_coo(acoo,info)
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entries to call C-base SuperLU
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_zslu_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%icp,acsc%ia,sv%lufactors)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_zslu_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine z_slu_solver_bld
|
||||
!!$ subroutine z_slu_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
!!$ complex(psb_dpk_),intent(inout) :: x(:)
|
||||
!!$ complex(psb_dpk_),intent(inout) :: y(:)
|
||||
!!$ complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ complex(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
!!$
|
||||
!!$ integer :: n_row,n_col
|
||||
!!$ complex(psb_dpk_), pointer :: ww(:)
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act
|
||||
!!$ character :: trans_
|
||||
!!$ character(len=20) :: name='z_slu_solver_apply'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$
|
||||
!!$ trans_ = psb_toupper(trans)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ case('T','C')
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ n_row = desc_data%get_local_rows()
|
||||
!!$ n_col = desc_data%get_local_cols()
|
||||
!!$
|
||||
!!$ if (n_col <= size(work)) then
|
||||
!!$ ww => work(1:n_col)
|
||||
!!$ else
|
||||
!!$ allocate(ww(n_col),stat=info)
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_alloc_request_
|
||||
!!$ call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
!!$ & a_err='complex(psb_dpk_)')
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ ww(1:n_row) = x(1:n_row)
|
||||
!!$ select case(trans_)
|
||||
!!$ case('N')
|
||||
!!$ info = amg_zslu_solve(0,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('T')
|
||||
!!$ info = amg_zslu_solve(1,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case('C')
|
||||
!!$ info = amg_zslu_solve(2,n_row,1,ww,n_row,sv%lufactors)
|
||||
!!$ case default
|
||||
!!$ call psb_errpush(psb_err_internal_error_, &
|
||||
!!$ & name,a_err='Invalid TRANS in ILU subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ end select
|
||||
!!$
|
||||
!!$ if (info == psb_success_) &
|
||||
!!$ & call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
!!$
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ call psb_errpush(psb_err_internal_error_,&
|
||||
!!$ & name,a_err='Error in subsolve')
|
||||
!!$ goto 9999
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ if (n_col > size(work)) then
|
||||
!!$ deallocate(ww)
|
||||
!!$ endif
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine z_slu_solver_apply
|
||||
!!$
|
||||
!!$ subroutine z_slu_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
!!$ & trans,work,wv,info,init,initu)
|
||||
!!$ use psb_base_mod
|
||||
!!$ implicit none
|
||||
!!$ type(psb_desc_type), intent(in) :: desc_data
|
||||
!!$ class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
!!$ type(psb_z_vect_type),intent(inout) :: x
|
||||
!!$ type(psb_z_vect_type),intent(inout) :: y
|
||||
!!$ complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
!!$ character(len=1),intent(in) :: trans
|
||||
!!$ complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
!!$ type(psb_z_vect_type),intent(inout) :: wv(:)
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ character, intent(in), optional :: init
|
||||
!!$ type(psb_z_vect_type),intent(inout), optional :: initu
|
||||
!!$
|
||||
!!$ integer :: err_act
|
||||
!!$ character(len=20) :: name='z_slu_solver_apply_vect'
|
||||
!!$
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$
|
||||
!!$ info = psb_success_
|
||||
!!$ !
|
||||
!!$ ! For non-iterative solvers, init and initu are ignored.
|
||||
!!$ !
|
||||
!!$
|
||||
!!$ call x%v%sync()
|
||||
!!$ call y%v%sync()
|
||||
!!$ call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
!!$ call y%v%set_host()
|
||||
!!$ if (info /= 0) goto 9999
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$ end subroutine z_slu_solver_apply_vect
|
||||
!!$
|
||||
!!$ subroutine z_slu_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
!!$
|
||||
!!$ use psb_base_mod
|
||||
!!$
|
||||
!!$ Implicit None
|
||||
!!$
|
||||
!!$ ! Arguments
|
||||
!!$ type(psb_zspmat_type), intent(in), target :: a
|
||||
!!$ Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
!!$ class(amg_z_slu_solver_type), intent(inout) :: sv
|
||||
!!$ integer, intent(out) :: info
|
||||
!!$ type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
!!$ class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
!!$ class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
!!$ class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
!!$ ! Local variables
|
||||
!!$ type(psb_zspmat_type) :: atmp
|
||||
!!$ type(psb_z_csc_sparse_mat) :: acsc
|
||||
!!$ type(psb_z_coo_sparse_mat) :: acoo
|
||||
!!$ integer :: n_row,n_col, nrow_a, nztota
|
||||
!!$ type(psb_ctxt_type) :: ctxt
|
||||
!!$ integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
!!$ character(len=20) :: name='z_slu_solver_bld', ch_err
|
||||
!!$
|
||||
!!$ info=psb_success_
|
||||
!!$ call psb_erractionsave(err_act)
|
||||
!!$ debug_unit = psb_get_debug_unit()
|
||||
!!$ debug_level = psb_get_debug_level()
|
||||
!!$ ctxt = desc_a%get_context()
|
||||
!!$ call psb_info(ctxt, me, np)
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' start'
|
||||
!!$
|
||||
!!$
|
||||
!!$ n_row = desc_a%get_local_rows()
|
||||
!!$ n_col = desc_a%get_local_cols()
|
||||
!!$
|
||||
!!$
|
||||
!!$ call a%cscnv(atmp,info,type='coo')
|
||||
!!$ call psb_rwextd(n_row,atmp,info,b=b)
|
||||
!!$ call atmp%cscnv(info,type='coo',dupl=psb_dupl_add_)
|
||||
!!$ nrow_a = atmp%get_nrows()
|
||||
!!$ call atmp%a%csclip(acoo,info,jmax=nrow_a)
|
||||
!!$ call acsc%mv_from_coo(acoo,info)
|
||||
!!$ nztota = acsc%get_nzeros()
|
||||
!!$ ! Fix the entries to call C-base SuperLU
|
||||
!!$ acsc%ia(:) = acsc%ia(:) - 1
|
||||
!!$ acsc%icp(:) = acsc%icp(:) - 1
|
||||
!!$ info = amg_zslu_fact(nrow_a,nztota,acsc%val,&
|
||||
!!$ & acsc%icp,acsc%ia,sv%lufactors)
|
||||
!!$
|
||||
!!$ if (info /= psb_success_) then
|
||||
!!$ info=psb_err_from_subroutine_
|
||||
!!$ ch_err='amg_zslu_fact'
|
||||
!!$ call psb_errpush(info,name,a_err=ch_err)
|
||||
!!$ goto 9999
|
||||
!!$ end if
|
||||
!!$
|
||||
!!$ call acsc%free()
|
||||
!!$ call atmp%free()
|
||||
!!$
|
||||
!!$ if (debug_level >= psb_debug_outer_) &
|
||||
!!$ & write(debug_unit,*) me,' ',trim(name),' end'
|
||||
!!$
|
||||
!!$ call psb_erractionrestore(err_act)
|
||||
!!$ return
|
||||
!!$
|
||||
!!$9999 call psb_error_handler(err_act)
|
||||
!!$ return
|
||||
!!$ end subroutine z_slu_solver_bld
|
||||
|
||||
subroutine z_slu_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ module amg_z_sludist_solver
|
||||
use iso_c_binding
|
||||
use amg_z_base_solver_mod
|
||||
|
||||
#if (!defined(HAVE_SLUDIST_)) || defined(IPK8)
|
||||
#if (!defined(AMG_HAVE_SLUDIST)) || defined(PSB_IPK8)
|
||||
|
||||
type, extends(amg_z_base_solver_type) :: amg_z_sludist_solver_type
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ contains
|
||||
character(len=*), intent(in), optional :: prefix
|
||||
|
||||
character(1024) :: prefix_
|
||||
|
||||
info = psb_success_
|
||||
if (present(prefix)) then
|
||||
prefix_ = prefix
|
||||
else
|
||||
|
||||
+63
-207
@@ -51,7 +51,7 @@ module amg_z_umf_solver
|
||||
use iso_c_binding
|
||||
use amg_z_base_solver_mod
|
||||
|
||||
#if defined(IPK8)
|
||||
#if defined(PSB_IPK8)
|
||||
type, extends(amg_z_base_solver_type) :: amg_z_umf_solver_type
|
||||
|
||||
end type amg_z_umf_solver_type
|
||||
@@ -62,9 +62,9 @@ module amg_z_umf_solver
|
||||
type(c_ptr) :: symbolic=c_null_ptr, numeric=c_null_ptr
|
||||
integer(c_long_long) :: symbsize=0, numsize=0
|
||||
contains
|
||||
procedure, pass(sv) :: build => z_umf_solver_bld
|
||||
procedure, pass(sv) :: apply_a => z_umf_solver_apply
|
||||
procedure, pass(sv) :: apply_v => z_umf_solver_apply_vect
|
||||
procedure, pass(sv) :: build => amg_z_umf_solver_bld
|
||||
procedure, pass(sv) :: apply_a => amg_z_umf_solver_apply
|
||||
procedure, pass(sv) :: apply_v => amg_z_umf_solver_apply_vect
|
||||
procedure, pass(sv) :: free => z_umf_solver_free
|
||||
procedure, pass(sv) :: clear_data => z_umf_solver_clear_data
|
||||
procedure, pass(sv) :: descr => z_umf_solver_descr
|
||||
@@ -75,9 +75,8 @@ module amg_z_umf_solver
|
||||
end type amg_z_umf_solver_type
|
||||
|
||||
|
||||
private :: z_umf_solver_bld, z_umf_solver_apply, &
|
||||
& z_umf_solver_free, z_umf_solver_descr, &
|
||||
& z_umf_solver_sizeof, z_umf_solver_apply_vect, &
|
||||
private :: z_umf_solver_free, z_umf_solver_descr, &
|
||||
& z_umf_solver_sizeof, &
|
||||
& z_umf_solver_get_fmt, z_umf_solver_get_id, &
|
||||
& z_umf_solver_clear_data
|
||||
private :: z_umf_solver_finalize
|
||||
@@ -118,208 +117,65 @@ module amg_z_umf_solver
|
||||
end function amg_zumf_free
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_umf_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_z_umf_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
complex(psb_dpk_),intent(inout) :: y(:)
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
end subroutine amg_z_umf_solver_apply
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_umf_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
import amg_z_umf_solver_type
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
type(psb_z_vect_type),intent(inout) :: y
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_z_vect_type),intent(inout) :: wv(:)
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_z_vect_type),intent(inout), optional :: initu
|
||||
end subroutine amg_z_umf_solver_apply_vect
|
||||
end interface
|
||||
|
||||
interface
|
||||
subroutine amg_z_umf_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
use psb_base_mod
|
||||
import amg_z_umf_solver_type
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
end subroutine amg_z_umf_solver_bld
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine z_umf_solver_apply(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
complex(psb_dpk_),intent(inout) :: x(:)
|
||||
complex(psb_dpk_),intent(inout) :: y(:)
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
complex(psb_dpk_),intent(inout), optional :: initu(:)
|
||||
|
||||
integer :: n_row,n_col
|
||||
complex(psb_dpk_), pointer :: ww(:)
|
||||
integer(psb_ipk_) :: i, err_act
|
||||
character :: trans_
|
||||
character(len=20) :: name='z_umf_solver_apply'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
|
||||
trans_ = psb_toupper(trans)
|
||||
select case(trans_)
|
||||
case('N')
|
||||
case('T','C')
|
||||
case default
|
||||
call psb_errpush(psb_err_iarg_invalid_i_,name)
|
||||
goto 9999
|
||||
end select
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
n_row = desc_data%get_local_rows()
|
||||
n_col = desc_data%get_local_cols()
|
||||
|
||||
if (n_col <= size(work)) then
|
||||
ww => work(1:n_col)
|
||||
else
|
||||
allocate(ww(n_col),stat=info)
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_alloc_request_
|
||||
call psb_errpush(info,name,i_err=(/n_col,0,0,0,0/),&
|
||||
& a_err='complex(psb_dpk_)')
|
||||
goto 9999
|
||||
end if
|
||||
endif
|
||||
|
||||
select case(trans_)
|
||||
case('N')
|
||||
info = amg_zumf_solve(0,n_row,ww,x,n_row,sv%numeric)
|
||||
case('T')
|
||||
!
|
||||
! Note: with UMF, 1 meand Ctranspose, 2 means transpose
|
||||
! even for complex data.
|
||||
!
|
||||
if (psb_z_is_complex_) then
|
||||
info = amg_zumf_solve(2,n_row,ww,x,n_row,sv%numeric)
|
||||
else
|
||||
info = amg_zumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
||||
end if
|
||||
case('C')
|
||||
info = amg_zumf_solve(1,n_row,ww,x,n_row,sv%numeric)
|
||||
case default
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Invalid TRANS in ILU subsolve')
|
||||
goto 9999
|
||||
end select
|
||||
|
||||
if (info == psb_success_) call psb_geaxpby(alpha,ww,beta,y,desc_data,info)
|
||||
|
||||
|
||||
if (info /= psb_success_) then
|
||||
call psb_errpush(psb_err_internal_error_,name,a_err='Error in subsolve')
|
||||
goto 9999
|
||||
endif
|
||||
|
||||
if (n_col > size(work)) then
|
||||
deallocate(ww)
|
||||
endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine z_umf_solver_apply
|
||||
|
||||
subroutine z_umf_solver_apply_vect(alpha,sv,x,beta,y,desc_data,&
|
||||
& trans,work,wv,info,init,initu)
|
||||
use psb_base_mod
|
||||
implicit none
|
||||
type(psb_desc_type), intent(in) :: desc_data
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
type(psb_z_vect_type),intent(inout) :: x
|
||||
type(psb_z_vect_type),intent(inout) :: y
|
||||
complex(psb_dpk_),intent(in) :: alpha,beta
|
||||
character(len=1),intent(in) :: trans
|
||||
complex(psb_dpk_),target, intent(inout) :: work(:)
|
||||
type(psb_z_vect_type),intent(inout) :: wv(:)
|
||||
integer, intent(out) :: info
|
||||
character, intent(in), optional :: init
|
||||
type(psb_z_vect_type),intent(inout), optional :: initu
|
||||
|
||||
integer :: err_act
|
||||
character(len=20) :: name='z_umf_solver_apply_vect'
|
||||
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
info = psb_success_
|
||||
!
|
||||
! For non-iterative solvers, init and initu are ignored.
|
||||
!
|
||||
|
||||
call x%v%sync()
|
||||
call y%v%sync()
|
||||
call sv%apply(alpha,x%v%v,beta,y%v%v,desc_data,trans,work,info)
|
||||
call y%v%set_host()
|
||||
if (info /= 0) goto 9999
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
end subroutine z_umf_solver_apply_vect
|
||||
|
||||
subroutine z_umf_solver_bld(a,desc_a,sv,info,b,amold,vmold,imold)
|
||||
|
||||
use psb_base_mod
|
||||
|
||||
Implicit None
|
||||
|
||||
! Arguments
|
||||
type(psb_zspmat_type), intent(in), target :: a
|
||||
Type(psb_desc_type), Intent(inout) :: desc_a
|
||||
class(amg_z_umf_solver_type), intent(inout) :: sv
|
||||
integer, intent(out) :: info
|
||||
type(psb_zspmat_type), intent(in), target, optional :: b
|
||||
class(psb_z_base_sparse_mat), intent(in), optional :: amold
|
||||
class(psb_z_base_vect_type), intent(in), optional :: vmold
|
||||
class(psb_i_base_vect_type), intent(in), optional :: imold
|
||||
! Local variables
|
||||
type(psb_zspmat_type) :: atmp
|
||||
type(psb_z_csc_sparse_mat) :: acsc
|
||||
integer :: n_row,n_col, nrow_a, nztota
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer :: np,me,i, err_act, debug_unit, debug_level
|
||||
character(len=20) :: name='z_umf_solver_bld', ch_err
|
||||
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt, me, np)
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' start'
|
||||
|
||||
|
||||
n_row = desc_a%get_local_rows()
|
||||
n_col = desc_a%get_local_cols()
|
||||
|
||||
call a%cscnv(atmp,info,type='coo')
|
||||
call psb_rwextd(n_row,atmp,info,b=b)
|
||||
call atmp%cscnv(info,type='csc',dupl=psb_dupl_add_)
|
||||
call atmp%mv_to(acsc)
|
||||
nrow_a = acsc%get_nrows()
|
||||
nztota = acsc%get_nzeros()
|
||||
! Fix the entres to call C-base UMFPACK.
|
||||
acsc%ia(:) = acsc%ia(:) - 1
|
||||
acsc%icp(:) = acsc%icp(:) - 1
|
||||
info = amg_zumf_fact(nrow_a,nztota,acsc%val,&
|
||||
& acsc%ia,acsc%icp,sv%symbolic,sv%numeric,&
|
||||
& sv%symbsize,sv%numsize)
|
||||
|
||||
if (info /= psb_success_) then
|
||||
info=psb_err_from_subroutine_
|
||||
ch_err='amg_zumf_fact'
|
||||
call psb_errpush(info,name,a_err=ch_err)
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
call acsc%free()
|
||||
call atmp%free()
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),' end'
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
end subroutine z_umf_solver_bld
|
||||
|
||||
subroutine z_umf_solver_free(sv,info)
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ MODDIR=../../modules
|
||||
HERE=..
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(PSBLAS_INCLUDES)
|
||||
CINCLUDES=-I. -I.. -I$(PSBLAS_INCDIR)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ MODDIR=../../../modules
|
||||
HERE=../..
|
||||
|
||||
FINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(MODDIR) $(FMFLAG)$(INCDIR) $(PSBLAS_INCLUDES)
|
||||
CXXINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/.
|
||||
CXXINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/. -I$(PSBLAS_INCDIR)
|
||||
CINCLUDES=$(FMFLAG)$(HERE) $(FMFLAG)$(INCDIR) $(FMFLAG)/. -I$(PSBLAS_INCDIR)
|
||||
|
||||
#CINCLUDES= -I${SUPERLU_INCDIR} -I${HSL_INCDIR} -I${SPRAL_INCDIR} -I/home/users/pasqua/Ambra/BootCMatch/include -lBCM -L/home/users/pasqua/Ambra/BootCMatch/lib -lm
|
||||
|
||||
@@ -61,7 +62,8 @@ amg_s_parmatch_unsmth_bld.o \
|
||||
amg_s_parmatch_smth_bld.o \
|
||||
amg_s_parmatch_spmm_bld_inner.o
|
||||
|
||||
MPCOBJS=MatchBoxPC.o \
|
||||
MPCOBJS=Matching.o \
|
||||
MatchBoxPC.o \
|
||||
sendBundledMessages.o \
|
||||
initialize.o \
|
||||
extractUChunk.o \
|
||||
|
||||
@@ -40,15 +40,17 @@
|
||||
// ************************************************************************
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if !defined(SERIAL_MPI)
|
||||
#include "amg_config.h"
|
||||
#include "MatchBoxPC.h"
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
#include "MatchBoxPC.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
|
||||
void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
MilanLongInt* verLocPtr, MilanLongInt* verLocInd, MilanReal* edgeLocWeight,
|
||||
@@ -58,7 +60,6 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
|
||||
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
|
||||
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
|
||||
#if !defined(SERIAL_MPI)
|
||||
MPI_Comm C_comm=MPI_Comm_f2c(icomm);
|
||||
|
||||
#ifdef DEBUG
|
||||
@@ -72,7 +73,7 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
double tmr = MPI_Wtime();
|
||||
#endif
|
||||
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
//fprintf(stderr,"Warning: using buggy OpenMP matching!\n");
|
||||
dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge,
|
||||
verLocPtr, verLocInd, edgeLocWeight,
|
||||
@@ -97,7 +98,6 @@ void dMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
fprintf(stderr, "Elaboration time: %f for %ld nodes\n", tmr, NLVer);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
@@ -108,13 +108,12 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
MilanLongInt* msgIndSent, MilanLongInt* msgActualSent, MilanReal* msgPercent,
|
||||
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
|
||||
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
|
||||
#if !defined(SERIAL_MPI)
|
||||
MPI_Comm C_comm=MPI_Comm_f2c(icomm);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr,"MatchBoxPC: rank %d nlver %ld nledge %ld [ %ld %ld ]\n",
|
||||
myRank,NLVer, NLEdge,verDistance[0],verDistance[1]);
|
||||
#endif
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
//fprintf(stderr,"Warning: using buggy OpenMP matching!\n");
|
||||
salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(NLVer, NLEdge,
|
||||
verLocPtr, verLocInd, edgeLocWeight,
|
||||
@@ -132,9 +131,10 @@ void sMatchBoxPC(MilanLongInt NLVer, MilanLongInt NLEdge,
|
||||
ph0_time, ph1_time, ph2_time,
|
||||
ph1_card, ph2_card );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -59,7 +59,10 @@
|
||||
#include <assert.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#ifdef OPENMP
|
||||
#include "amg_config.h"
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
|
||||
#ifdef PSB_OPENMP
|
||||
// OpenMP is included and used if and only if the OpenMP version of the matching
|
||||
// is required
|
||||
#include "omp.h"
|
||||
@@ -82,7 +85,6 @@ const int BundleTag = 9; // Predefined tag
|
||||
|
||||
static vector<MilanLongInt> DEFAULT_VECTOR;
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
// MPI type map
|
||||
template <typename T>
|
||||
@@ -95,14 +97,12 @@ template <>
|
||||
inline MPI_Datatype TypeMap<double>() { return MPI_DOUBLE; }
|
||||
template <>
|
||||
inline MPI_Datatype TypeMap<float>() { return MPI_FLOAT; }
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
#define MilanMpiLongInt MPI_LONG_LONG
|
||||
|
||||
@@ -117,7 +117,7 @@ extern "C"
|
||||
// Regular long integer:
|
||||
#ifndef LONG_INT_H
|
||||
#define LONG_INT_H
|
||||
#ifdef BIT64
|
||||
#ifdef AMG_MATCHBOXP_BIT64
|
||||
typedef int64_t MilanLongInt;
|
||||
typedef MPI_LONG MilanMpiLongInt;
|
||||
#else
|
||||
@@ -163,7 +163,7 @@ extern "C"
|
||||
#define MilanIntMax INT32_MAX
|
||||
#define MilanIntMin INT32_MIN
|
||||
|
||||
#ifdef BIT64
|
||||
#ifdef AMG_MATCHBOXP_BIT64
|
||||
#define MilanLongIntMax INT64_MAX
|
||||
#define MilanLongIntMin -INT64_MAX
|
||||
#else
|
||||
@@ -630,8 +630,9 @@ is disabled there is no reason to actually compile or reference them. */
|
||||
MilanReal *ph0_time, MilanReal *ph1_time, MilanReal *ph2_time,
|
||||
MilanLongInt *ph1_card, MilanLongInt *ph2_card);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,504 @@
|
||||
/*
|
||||
AMG4PSBLAS version 1.2
|
||||
Algebraic Multigrid Package
|
||||
based on PSBLAS (Parallel Sparse BLAS version 3.9)
|
||||
|
||||
(C) Copyright 2021
|
||||
|
||||
Salvatore Filippone
|
||||
Pasqua D'Ambra
|
||||
Fabio Durastante
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
not be used to endorse or promote products derived from this
|
||||
software without specific written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Includes material from BootCMatch, see copyright below.
|
||||
*/
|
||||
|
||||
/*
|
||||
BootCMatch
|
||||
Bootstrap AMG based on Compatible weighted Matching, version 0.9
|
||||
(C) Copyright 2017
|
||||
Pasqua D'Ambra IAC-CNR, IT
|
||||
Panayot S. Vassilevski Portland State University, OR USA
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the BootCMatch group or the names of its contributors may
|
||||
not be used to endorse or promote products derived from this
|
||||
software without specific written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE BootCMatch GROUP OR ITS CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
#include "amg_config.h"
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
#include <stdlib.h>
|
||||
#include "psb_types.h"
|
||||
|
||||
psb_l_t d_trymatch(psb_l_t rowindex, psb_l_t colindex,
|
||||
psb_l_t nrows_W, psb_l_t *W_i, psb_l_t *W_j, psb_d_t *W_data,
|
||||
psb_l_t *jrowindex, psb_l_t ljrowindex,
|
||||
psb_l_t *jcolindex, psb_l_t ljcolindex, psb_l_t *rmatch)
|
||||
{
|
||||
|
||||
psb_l_t tryrowmatch, trycolmatch;
|
||||
psb_l_t i, j, k, nzrow_W, startj, kindex;
|
||||
psb_d_t cweight, nweight;
|
||||
|
||||
// psb_l_t *W_i = bcm_CSRMatrixI(W);
|
||||
// psb_l_t *W_j = bcm_CSRMatrixJ(W);
|
||||
// psb_l_t nrows_W = bcm_CSRMatrixNumRows(W);
|
||||
// psb_d_t *W_data=bcm_CSRMatrixData(W);
|
||||
|
||||
k=-1;
|
||||
i=0;
|
||||
while (i<ljrowindex && k ==-1)
|
||||
{
|
||||
if(jrowindex[i]==colindex) k=i;
|
||||
i++;
|
||||
}
|
||||
if(k >= 0)
|
||||
{
|
||||
ljrowindex=ljrowindex-1;
|
||||
for(i=k; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
|
||||
}
|
||||
|
||||
k=-1;
|
||||
i=0;
|
||||
while(i<ljcolindex && k==-1)
|
||||
{
|
||||
if(jcolindex[i]==rowindex) k=i;
|
||||
i++;
|
||||
}
|
||||
if(k >= 0)
|
||||
{
|
||||
ljcolindex=ljcolindex-1;
|
||||
for(i=k; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
|
||||
}
|
||||
|
||||
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
|
||||
startj=W_i[rowindex];
|
||||
kindex=-1;
|
||||
k=0;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==colindex) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
cweight=W_data[kindex];
|
||||
|
||||
while((rmatch[rowindex]==-1 && rmatch[colindex]==-1)
|
||||
&& (ljrowindex !=0 || ljcolindex !=0))
|
||||
{
|
||||
|
||||
if (rmatch[rowindex] == -1 && ljrowindex !=0)
|
||||
{
|
||||
tryrowmatch=jrowindex[0];
|
||||
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
|
||||
startj=W_i[rowindex];
|
||||
k=0;
|
||||
kindex=-1;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==tryrowmatch) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
nweight=W_data[kindex];
|
||||
|
||||
ljrowindex=ljrowindex-1;
|
||||
for(i=0; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
|
||||
|
||||
if(nweight > cweight && rmatch[tryrowmatch]==-1)
|
||||
{
|
||||
|
||||
nzrow_W=W_i[tryrowmatch+1]-W_i[tryrowmatch];
|
||||
psb_l_t *trymatchindexrow;
|
||||
trymatchindexrow= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
|
||||
|
||||
startj=W_i[tryrowmatch];
|
||||
for(k=0; k<nzrow_W; ++k) trymatchindexrow[k]=W_j[startj+k];
|
||||
|
||||
d_trymatch(rowindex,tryrowmatch,
|
||||
nrows_W, W_i, W_j, W_data,
|
||||
jrowindex,ljrowindex,
|
||||
trymatchindexrow,nzrow_W,rmatch);
|
||||
free(trymatchindexrow);
|
||||
}
|
||||
}
|
||||
|
||||
if(rmatch[colindex]==-1 && ljcolindex!=0)
|
||||
{
|
||||
trycolmatch=jcolindex[0];
|
||||
nzrow_W=W_i[colindex+1]-W_i[colindex];
|
||||
startj=W_i[colindex];
|
||||
k=0;
|
||||
kindex=-1;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==trycolmatch) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
nweight=W_data[kindex];
|
||||
|
||||
ljcolindex=ljcolindex-1;
|
||||
for(i=0; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
|
||||
|
||||
if(nweight > cweight && rmatch[trycolmatch]==-1)
|
||||
{
|
||||
nzrow_W=W_i[trycolmatch+1]-W_i[trycolmatch];
|
||||
psb_l_t *trymatchindexcol;
|
||||
trymatchindexcol= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
|
||||
|
||||
startj=W_i[trycolmatch];
|
||||
for(k=0; k<nzrow_W; ++k) trymatchindexcol[k]=W_j[startj+k];
|
||||
|
||||
d_trymatch(colindex,trycolmatch,
|
||||
nrows_W, W_i, W_j, W_data,
|
||||
jcolindex,ljcolindex,
|
||||
trymatchindexcol,nzrow_W,rmatch);
|
||||
free(trymatchindexcol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rmatch[rowindex]==-1 & rmatch[colindex]==-1)
|
||||
{
|
||||
rmatch[rowindex]=colindex;
|
||||
rmatch[colindex]=rowindex;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
psb_l_t *d_CSRMatrixHMatch( psb_l_t nrows_B, psb_l_t ncols_B,
|
||||
psb_l_t nnz_B, psb_l_t *B_i,
|
||||
psb_l_t *B_j, psb_d_t *B_data)
|
||||
{
|
||||
|
||||
psb_l_t i, j, k, *rmatch;
|
||||
psb_d_t *c, alpha;
|
||||
psb_l_t jbp, nzrows_B;
|
||||
psb_d_t tmp=0.0;
|
||||
psb_l_t rno, cno, nzrows_cno, startj, ljrowindex, ljjrowindex;
|
||||
psb_l_t *jrowindex, *jjrowindex;
|
||||
|
||||
#if 0
|
||||
psb_l_t *B_i = bcm_CSRMatrixI(B);
|
||||
psb_l_t *B_j = bcm_CSRMatrixJ(B);
|
||||
psb_d_t *B_data = bcm_CSRMatrixData(B);
|
||||
psb_l_t nrows_B = bcm_CSRMatrixNumRows(B);
|
||||
psb_l_t ncols_B = bcm_CSRMatrixNumCols(B);
|
||||
psb_l_t nnz_B = bcm_CSRMatrixNumNonzeros(B);
|
||||
#endif
|
||||
// assert(nrows_B==ncols_B);
|
||||
|
||||
rmatch = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
|
||||
for(i=0; i<nrows_B; ++i) rmatch[i]=-1;
|
||||
|
||||
jrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
jjrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
|
||||
jbp=0;
|
||||
for(i=0; i< nrows_B; ++i)
|
||||
{
|
||||
nzrows_B=B_i[i+1]-B_i[i];
|
||||
|
||||
for(j=0; j<nzrows_B; ++j) jrowindex[j]=B_j[jbp+j];
|
||||
for(j=0; j<nzrows_B; ++j)
|
||||
{
|
||||
rno=i;
|
||||
cno=B_j[jbp+j];
|
||||
|
||||
startj=B_i[cno];
|
||||
nzrows_cno=B_i[cno+1]-startj;
|
||||
|
||||
for(k=0; k<nzrows_cno; ++k) jjrowindex[k]=B_j[startj+k];
|
||||
|
||||
if(rmatch[rno] == -1 && rmatch[cno] == -1)
|
||||
d_trymatch(rno,cno,nrows_B,B_i,B_j,B_data,
|
||||
jrowindex,nzrows_B,jjrowindex,nzrows_cno,rmatch);
|
||||
|
||||
}
|
||||
|
||||
jbp=jbp+nzrows_B;
|
||||
}
|
||||
|
||||
free(jrowindex);
|
||||
free(jjrowindex);
|
||||
|
||||
return rmatch;
|
||||
}
|
||||
|
||||
|
||||
void dMatching(psb_l_t NLVer, psb_l_t NLEdge,
|
||||
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_d_t *edgeLocWeight,
|
||||
psb_l_t *verDistance, psb_l_t *Mate)
|
||||
{
|
||||
psb_l_t *lmate;
|
||||
lmate = d_CSRMatrixHMatch( NLVer, NLVer, NLEdge,
|
||||
verLocPtr, verLocInd,edgeLocWeight);
|
||||
for (psb_l_t i=0; i<NLVer; i++){
|
||||
Mate[i] = lmate[i];
|
||||
}
|
||||
free(lmate);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
psb_l_t s_trymatch(psb_l_t rowindex, psb_l_t colindex,
|
||||
psb_l_t nrows_W, psb_l_t *W_i, psb_l_t *W_j, psb_s_t *W_data,
|
||||
psb_l_t *jrowindex, psb_l_t ljrowindex,
|
||||
psb_l_t *jcolindex, psb_l_t ljcolindex, psb_l_t *rmatch)
|
||||
{
|
||||
|
||||
psb_l_t tryrowmatch, trycolmatch;
|
||||
psb_l_t i, j, k, nzrow_W, startj, kindex;
|
||||
psb_s_t cweight, nweight;
|
||||
|
||||
// psb_l_t *W_i = bcm_CSRMatrixI(W);
|
||||
// psb_l_t *W_j = bcm_CSRMatrixJ(W);
|
||||
// psb_l_t nrows_W = bcm_CSRMatrixNumRows(W);
|
||||
// psb_s_t *W_data=bcm_CSRMatrixData(W);
|
||||
|
||||
k=-1;
|
||||
i=0;
|
||||
while (i<ljrowindex && k ==-1)
|
||||
{
|
||||
if(jrowindex[i]==colindex) k=i;
|
||||
i++;
|
||||
}
|
||||
if(k >= 0)
|
||||
{
|
||||
ljrowindex=ljrowindex-1;
|
||||
for(i=k; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
|
||||
}
|
||||
|
||||
k=-1;
|
||||
i=0;
|
||||
while(i<ljcolindex && k==-1)
|
||||
{
|
||||
if(jcolindex[i]==rowindex) k=i;
|
||||
i++;
|
||||
}
|
||||
if(k >= 0)
|
||||
{
|
||||
ljcolindex=ljcolindex-1;
|
||||
for(i=k; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
|
||||
}
|
||||
|
||||
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
|
||||
startj=W_i[rowindex];
|
||||
kindex=-1;
|
||||
k=0;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==colindex) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
cweight=W_data[kindex];
|
||||
|
||||
while((rmatch[rowindex]==-1 && rmatch[colindex]==-1)
|
||||
&& (ljrowindex !=0 || ljcolindex !=0))
|
||||
{
|
||||
|
||||
if (rmatch[rowindex] == -1 && ljrowindex !=0)
|
||||
{
|
||||
tryrowmatch=jrowindex[0];
|
||||
nzrow_W=W_i[rowindex+1]-W_i[rowindex];
|
||||
startj=W_i[rowindex];
|
||||
k=0;
|
||||
kindex=-1;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==tryrowmatch) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
nweight=W_data[kindex];
|
||||
|
||||
ljrowindex=ljrowindex-1;
|
||||
for(i=0; i<ljrowindex; ++i) jrowindex[i]=jrowindex[i+1];
|
||||
|
||||
if(nweight > cweight && rmatch[tryrowmatch]==-1)
|
||||
{
|
||||
|
||||
nzrow_W=W_i[tryrowmatch+1]-W_i[tryrowmatch];
|
||||
psb_l_t *trymatchindexrow;
|
||||
trymatchindexrow= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
|
||||
|
||||
startj=W_i[tryrowmatch];
|
||||
for(k=0; k<nzrow_W; ++k) trymatchindexrow[k]=W_j[startj+k];
|
||||
|
||||
s_trymatch(rowindex,tryrowmatch,
|
||||
nrows_W, W_i, W_j, W_data,
|
||||
jrowindex,ljrowindex,
|
||||
trymatchindexrow,nzrow_W,rmatch);
|
||||
free(trymatchindexrow);
|
||||
}
|
||||
}
|
||||
|
||||
if(rmatch[colindex]==-1 && ljcolindex!=0)
|
||||
{
|
||||
trycolmatch=jcolindex[0];
|
||||
nzrow_W=W_i[colindex+1]-W_i[colindex];
|
||||
startj=W_i[colindex];
|
||||
k=0;
|
||||
kindex=-1;
|
||||
while(k<nzrow_W && kindex==-1)
|
||||
{
|
||||
if(W_j[startj+k]==trycolmatch) kindex=startj+k;
|
||||
k++;
|
||||
}
|
||||
nweight=W_data[kindex];
|
||||
|
||||
ljcolindex=ljcolindex-1;
|
||||
for(i=0; i<ljcolindex; ++i) jcolindex[i]=jcolindex[i+1];
|
||||
|
||||
if(nweight > cweight && rmatch[trycolmatch]==-1)
|
||||
{
|
||||
nzrow_W=W_i[trycolmatch+1]-W_i[trycolmatch];
|
||||
psb_l_t *trymatchindexcol;
|
||||
trymatchindexcol= (psb_l_t *) calloc(nzrow_W, sizeof(psb_l_t));
|
||||
|
||||
startj=W_i[trycolmatch];
|
||||
for(k=0; k<nzrow_W; ++k) trymatchindexcol[k]=W_j[startj+k];
|
||||
|
||||
s_trymatch(colindex,trycolmatch,
|
||||
nrows_W, W_i, W_j, W_data,
|
||||
jcolindex,ljcolindex,
|
||||
trymatchindexcol,nzrow_W,rmatch);
|
||||
free(trymatchindexcol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rmatch[rowindex]==-1 & rmatch[colindex]==-1)
|
||||
{
|
||||
rmatch[rowindex]=colindex;
|
||||
rmatch[colindex]=rowindex;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
psb_l_t *s_CSRMatrixHMatch( psb_l_t nrows_B, psb_l_t ncols_B,
|
||||
psb_l_t nnz_B, psb_l_t *B_i,
|
||||
psb_l_t *B_j, psb_s_t *B_data)
|
||||
{
|
||||
|
||||
psb_l_t i, j, k, *rmatch;
|
||||
psb_s_t *c, alpha;
|
||||
psb_l_t jbp, nzrows_B;
|
||||
psb_s_t tmp=0.0;
|
||||
psb_l_t rno, cno, nzrows_cno, startj, ljrowindex, ljjrowindex;
|
||||
psb_l_t *jrowindex, *jjrowindex;
|
||||
|
||||
#if 0
|
||||
psb_l_t *B_i = bcm_CSRMatrixI(B);
|
||||
psb_l_t *B_j = bcm_CSRMatrixJ(B);
|
||||
psb_s_t *B_data = bcm_CSRMatrixData(B);
|
||||
psb_l_t nrows_B = bcm_CSRMatrixNumRows(B);
|
||||
psb_l_t ncols_B = bcm_CSRMatrixNumCols(B);
|
||||
psb_l_t nnz_B = bcm_CSRMatrixNumNonzeros(B);
|
||||
#endif
|
||||
// assert(nrows_B==ncols_B);
|
||||
|
||||
rmatch = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
|
||||
for(i=0; i<nrows_B; ++i) rmatch[i]=-1;
|
||||
|
||||
jrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
jjrowindex = (psb_l_t *) calloc(nrows_B, sizeof(psb_l_t));
|
||||
|
||||
jbp=0;
|
||||
for(i=0; i< nrows_B; ++i)
|
||||
{
|
||||
nzrows_B=B_i[i+1]-B_i[i];
|
||||
|
||||
for(j=0; j<nzrows_B; ++j) jrowindex[j]=B_j[jbp+j];
|
||||
for(j=0; j<nzrows_B; ++j)
|
||||
{
|
||||
rno=i;
|
||||
cno=B_j[jbp+j];
|
||||
|
||||
startj=B_i[cno];
|
||||
nzrows_cno=B_i[cno+1]-startj;
|
||||
|
||||
for(k=0; k<nzrows_cno; ++k) jjrowindex[k]=B_j[startj+k];
|
||||
|
||||
if(rmatch[rno] == -1 && rmatch[cno] == -1)
|
||||
s_trymatch(rno,cno,nrows_B,B_i,B_j,B_data,
|
||||
jrowindex,nzrows_B,jjrowindex,nzrows_cno,rmatch);
|
||||
|
||||
}
|
||||
|
||||
jbp=jbp+nzrows_B;
|
||||
}
|
||||
|
||||
free(jrowindex);
|
||||
free(jjrowindex);
|
||||
|
||||
return rmatch;
|
||||
}
|
||||
|
||||
|
||||
void sMatching(psb_l_t NLVer, psb_l_t NLEdge,
|
||||
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_s_t *edgeLocWeight,
|
||||
psb_l_t *verDistance, psb_l_t *Mate)
|
||||
{
|
||||
|
||||
psb_l_t *lmate;
|
||||
lmate = s_CSRMatrixHMatch( NLVer, NLVer, NLEdge,
|
||||
verLocPtr, verLocInd,edgeLocWeight);
|
||||
for (psb_l_t i=0; i<NLVer; i++){
|
||||
Mate[i] = lmate[i];
|
||||
}
|
||||
free(lmate);
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
AMG4PSBLAS version 1.2
|
||||
Algebraic Multigrid Package
|
||||
based on PSBLAS (Parallel Sparse BLAS version 3.9)
|
||||
|
||||
(C) Copyright 2021
|
||||
|
||||
Salvatore Filippone
|
||||
Pasqua D'Ambra
|
||||
Fabio Durastante
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the AMG4PSBLAS group or the names of its contributors may
|
||||
not be used to endorse or promote products derived from this
|
||||
software without specific written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AMG4PSBLAS GROUP OR ITS CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
Includes material from BootCMatch, see copyright below.
|
||||
*/
|
||||
|
||||
/*
|
||||
BootCMatch
|
||||
Bootstrap AMG based on Compatible weighted Matching, version 0.9
|
||||
(C) Copyright 2017
|
||||
Pasqua D'Ambra IAC-CNR, IT
|
||||
Panayot S. Vassilevski Portland State University, OR USA
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions, and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. The name of the BootCMatch group or the names of its contributors may
|
||||
not be used to endorse or promote products derived from this
|
||||
software without specific written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE BootCMatch GROUP OR ITS CONTRIBUTORS
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
#include "amg_config.h"
|
||||
|
||||
#if defined(PSB_SERIAL_MPI)
|
||||
#include "psb_types.h"
|
||||
void dMatching(psb_l_t NLVer, psb_l_t NLEdge,
|
||||
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_d_t *edgeLocWeight,
|
||||
psb_l_t *verDistance, psb_l_t *Mate);
|
||||
void sMatching(psb_l_t NLVer, psb_l_t NLEdge,
|
||||
psb_l_t *verLocPtr, psb_l_t *verLocInd, psb_s_t *edgeLocWeight,
|
||||
psb_l_t *verDistance, psb_l_t *Mate);
|
||||
#endif
|
||||
+3
-3
@@ -70,7 +70,7 @@
|
||||
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
|
||||
*/
|
||||
|
||||
#ifdef SERIAL_MPI
|
||||
#ifdef PSB_SERIAL_MPI
|
||||
#else
|
||||
|
||||
// DOUBLE PRECISION VERSION
|
||||
@@ -86,7 +86,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
|
||||
MilanReal* msgPercent,
|
||||
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
|
||||
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
|
||||
#if !defined(SERIAL_MPI)
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
#ifdef PRINT_DEBUG_INFO_
|
||||
cout<<"\n("<<myRank<<")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()"; fflush(stdout);
|
||||
#endif
|
||||
@@ -1313,7 +1313,7 @@ void salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateC(
|
||||
MilanReal* msgPercent,
|
||||
MilanReal* ph0_time, MilanReal* ph1_time, MilanReal* ph2_time,
|
||||
MilanLongInt* ph1_card, MilanLongInt* ph2_card ) {
|
||||
#if !defined(SERIAL_MPI)
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
#ifdef PRINT_DEBUG_INFO_
|
||||
cout<<"\n("<<myRank<<")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()"; fflush(stdout);
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -70,7 +70,7 @@
|
||||
Statistics: ph1_card, ph2_card : Size: |P| number of processes in the comm-world (number of matched edges in Phase 1 and Phase 2)
|
||||
*/
|
||||
//#define DEBUG_HANG_
|
||||
#ifdef SERIAL_MPI
|
||||
#ifdef PSB_SERIAL_MPI
|
||||
#else
|
||||
|
||||
// DOUBLE PRECISION VERSION
|
||||
@@ -102,7 +102,7 @@ void dalgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
|
||||
* i+1-th value is the position of the first element on the i+1-th row
|
||||
*/
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
#ifdef PRINT_DEBUG_INFO_
|
||||
cout << "\n(" << myRank << ")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()";
|
||||
fflush(stdout);
|
||||
@@ -583,7 +583,7 @@ void salgoDistEdgeApproxDomEdgesLinearSearchMesgBndlSmallMateCMP(
|
||||
* i+1-th value is the position of the first element on the i+1-th row
|
||||
*/
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
#if !defined(PSB_SERIAL_MPI)
|
||||
#ifdef PRINT_DEBUG_INFO_
|
||||
cout << "\n(" << myRank << ")Within algoEdgeApproxDominatingEdgesLinearSearchMessageBundling()";
|
||||
fflush(stdout);
|
||||
|
||||
@@ -216,6 +216,7 @@ subroutine amg_c_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
@@ -420,6 +421,7 @@ subroutine amg_c_lc_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
@@ -486,7 +488,7 @@ subroutine amg_lc_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
integer(psb_lpk_) :: nrow, nglob, ncol, ntaggr, nrl, nzl, ip, &
|
||||
& nzt, naggrm1, naggrp1, i, k
|
||||
integer(psb_lpk_) :: nrsave, ncsave, nzsave, nza
|
||||
logical, parameter :: do_timings=.true., oldstyle=.false., debug=.false.
|
||||
logical, parameter :: do_timings=.false., oldstyle=.false., debug=.false.
|
||||
integer(psb_ipk_), save :: idx_spspmm=-1
|
||||
|
||||
name='amg_ptap_bld'
|
||||
@@ -629,6 +631,7 @@ subroutine amg_lc_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ subroutine amg_c_rap(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_c_inner_mod
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
use omp_lib
|
||||
#endif
|
||||
implicit none
|
||||
@@ -103,7 +103,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
character(len=20) :: name, ch_err
|
||||
integer(psb_ipk_), save :: idx_soc1_p1=-1, idx_soc1_p2=-1, idx_soc1_p3=-1
|
||||
integer(psb_ipk_), save :: idx_soc1_p0=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
info=psb_success_
|
||||
name = 'amg_soc1_map_bld'
|
||||
@@ -172,7 +172,7 @@ subroutine amg_c_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
! Phase one: Start with disjoint groups.
|
||||
!
|
||||
naggr = 0
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
block
|
||||
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
|
||||
integer(psb_ipk_) :: myth,nths, kk
|
||||
|
||||
@@ -71,7 +71,7 @@ subroutine amg_c_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_c_inner_mod
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
use omp_lib
|
||||
#endif
|
||||
|
||||
@@ -104,7 +104,7 @@ subroutine amg_c_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
character(len=20) :: name, ch_err
|
||||
integer(psb_ipk_), save :: idx_soc2_p1=-1, idx_soc2_p2=-1, idx_soc2_p3=-1
|
||||
integer(psb_ipk_), save :: idx_soc2_p0=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
info=psb_success_
|
||||
name = 'amg_soc2_map_bld'
|
||||
@@ -211,7 +211,7 @@ subroutine amg_c_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
! Phase one: Start with disjoint groups.
|
||||
!
|
||||
naggr = 0
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
block
|
||||
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
|
||||
integer(psb_ipk_) :: myth,nths, kk
|
||||
|
||||
@@ -80,7 +80,7 @@ subroutine amg_c_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
& a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_c_prec_type
|
||||
use amg_c_symdec_aggregator_mod, amg_protect_name => amg_c_symdec_aggregator_build_tprol
|
||||
use amg_c_symdec_aggregator_mod, only : amg_c_symdec_aggregator_type
|
||||
use amg_c_inner_mod
|
||||
implicit none
|
||||
class(amg_c_symdec_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -103,6 +103,16 @@ subroutine amg_c_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
integer(psb_ipk_) :: debug_level, debug_unit
|
||||
logical :: clean_zeros
|
||||
|
||||
!!$ interface
|
||||
!!$ subroutine psb_caplusat(ain,aout,info)
|
||||
!!$ use psb_c_mat_mod, only : psb_cspmat_type
|
||||
!!$ import :: psb_ipk_
|
||||
!!$ implicit none
|
||||
!!$ type(psb_cspmat_type) :: ain, aout
|
||||
!!$ integer(psb_ipk_) :: info
|
||||
!!$ end subroutine psb_caplusat
|
||||
!!$ end interface
|
||||
!!$
|
||||
name='amg_c_symdec_aggregator_tprol'
|
||||
call psb_erractionsave(err_act)
|
||||
if (psb_errstatus_fatal()) then
|
||||
@@ -123,15 +133,11 @@ subroutine amg_c_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)
|
||||
|
||||
nr = a%get_nrows()
|
||||
call a%csclip(atmp,info,imax=nr,jmax=nr,&
|
||||
call a%csclip(atrans,info,imax=nr,jmax=nr,&
|
||||
& rscale=.false.,cscale=.false.)
|
||||
call atmp%set_nrows(nr)
|
||||
call atmp%set_ncols(nr)
|
||||
if (info == psb_success_) call atmp%transp(atrans)
|
||||
if (info == psb_success_) call atrans%cscnv(info,type='COO')
|
||||
if (info == psb_success_) call psb_rwextd(nr,atmp,info,b=atrans,rowscale=.false.)
|
||||
call atmp%set_nrows(nr)
|
||||
call atmp%set_ncols(nr)
|
||||
call atrans%set_nrows(nr)
|
||||
call atrans%set_ncols(nr)
|
||||
call psb_aplusat(atrans,atmp,info)
|
||||
if (info == psb_success_) call atrans%free()
|
||||
if (info == psb_success_) call atmp%cscnv(info,type='CSR')
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
use amg_base_prec_type
|
||||
use amg_c_inner_mod, amg_protect_name => amg_caggrmat_smth_bld
|
||||
use amg_c_base_aggregator_mod
|
||||
! use, intrinsic :: ieee_arithmetic
|
||||
|
||||
implicit none
|
||||
|
||||
@@ -192,7 +193,7 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
|
||||
naggrm1 = sum(nlaggr(1:me))
|
||||
naggrp1 = sum(nlaggr(1:me+1))
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_)
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_).or.(parms%aggr_filter == amg_filter_prow_mat_)
|
||||
|
||||
!
|
||||
! naggr: number of local aggregates
|
||||
@@ -220,7 +221,7 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
! \tilde{D}_{i,i} = \sum_{j \ne i} |a_{i,j}|
|
||||
!$OMP parallel do private(i) schedule(static)
|
||||
do i=1,size(adiag)
|
||||
adiag(i) = adiag(i) + l1rwsum(i) - abs(adiag(i))
|
||||
adiag(i) = adiag(i) + l1rwsum(i) - abs(adiag(i))
|
||||
end do
|
||||
!$OMP end parallel do
|
||||
end if
|
||||
@@ -257,8 +258,13 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
if (jd == -1) then
|
||||
! if (.not.do_l1correction)
|
||||
write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
else
|
||||
else if (parms%aggr_filter == amg_filter_mat_) then
|
||||
! We perform filtering in the standard way assuming that A is an M-matrix
|
||||
acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
else if (parms%aggr_filter == amg_filter_prow_mat_) then
|
||||
! We are probably doing l1-correction, hence we want to preserve the
|
||||
! row sum of the matrix: note the change in sign
|
||||
acsrf%val(jd)=acsrf%val(jd)+tmp
|
||||
end if
|
||||
enddo
|
||||
!$OMP end parallel do
|
||||
@@ -266,7 +272,6 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
call acsrf%clean_zeros(info)
|
||||
end if
|
||||
|
||||
|
||||
!$OMP parallel do private(i) schedule(static)
|
||||
do i=1,size(adiag)
|
||||
if (adiag(i) /= czero) then
|
||||
@@ -278,11 +283,11 @@ subroutine amg_caggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
!$OMP end parallel do
|
||||
if (parms%aggr_omega_alg == amg_eig_est_) then
|
||||
|
||||
!if (do_l1correction) then
|
||||
! ! For l1-Jacobi this can be estimated with 1
|
||||
! parms%aggr_omega_val = done
|
||||
!
|
||||
if (parms%aggr_eig == amg_max_norm_) then
|
||||
if ( (parms%aggr_filter == amg_filter_prow_mat_).and.(do_l1correction) ) then
|
||||
! For l1-Jacobi this can be estimated with 1:
|
||||
! this makes sense only if we are preserving the row-sum!
|
||||
parms%aggr_omega_val = done
|
||||
else if (parms%aggr_eig == amg_max_norm_) then
|
||||
allocate(arwsum(nrow))
|
||||
call acsr%arwsum(arwsum)
|
||||
anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow)))
|
||||
|
||||
@@ -98,11 +98,7 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
& ac,desc_ac, op_prol,op_restr,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_inner_mat_asb
|
||||
#endif
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
@@ -133,8 +129,6 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
if (debug) write(0,*) me,' ',trim(name),' Start:',&
|
||||
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
|
||||
|
||||
@@ -146,16 +140,17 @@ subroutine amg_d_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
case(amg_repl_mat_)
|
||||
!
|
||||
!
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
|
||||
goto 9999
|
||||
|
||||
if (np>1) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
|
||||
goto 9999
|
||||
end if
|
||||
case default
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
|
||||
goto 9999
|
||||
end select
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -98,11 +98,7 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
& ac,desc_ac, op_prol,op_restr,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_mat_asb
|
||||
#endif
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_dml_parms), intent(inout) :: parms
|
||||
@@ -112,7 +108,7 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
!
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: np, me
|
||||
type(psb_ld_coo_sparse_mat) :: tmpcoo
|
||||
type(psb_ldspmat_type) :: tmp_ac
|
||||
@@ -128,15 +124,13 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
info = psb_success_
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt,me,np)
|
||||
if (psb_get_errstatus().ne.0) then
|
||||
write(0,*) me,' From:',trim(name),':',psb_get_errstatus()
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
if (debug) write(0,*) me,' ',trim(name),' Start:',&
|
||||
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
|
||||
|
||||
@@ -169,22 +163,21 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
call op_prol%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
call psb_loc_to_glob(tmpcoo%ja(1:nzl),desc_ac,info,'I')
|
||||
call tmpcoo%set_ncols(i_nr)
|
||||
call op_prol%mv_from(tmpcoo)
|
||||
|
||||
call op_restr%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
call psb_loc_to_glob(tmpcoo%ia(1:nzl),desc_ac,info,'I')
|
||||
call tmpcoo%set_nrows(i_nr)
|
||||
call op_restr%mv_from(tmpcoo)
|
||||
|
||||
call op_prol%set_ncols(i_nr)
|
||||
call op_restr%set_nrows(i_nr)
|
||||
|
||||
call psb_gather(tmp_ac,ac,desc_ac,info,root=-ione,&
|
||||
& dupl=psb_dupl_add_,keeploc=.false.)
|
||||
call tmp_ac%mv_to(tmpcoo)
|
||||
call ac%mv_from(tmpcoo)
|
||||
|
||||
call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.)
|
||||
call psb_cdall(ctxt,desc_ac,info,mg=ntaggr,repl=.true.)
|
||||
if (info == psb_success_) call psb_cdasb(desc_ac,info)
|
||||
!
|
||||
! Now that we have the descriptors and the restrictor, we should
|
||||
@@ -199,7 +192,7 @@ subroutine amg_d_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
|
||||
goto 9999
|
||||
end select
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -135,11 +135,7 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
use psb_base_mod
|
||||
use amg_d_inner_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_mat_bld
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -176,7 +172,6 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
! algorithm specified by
|
||||
!
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
call clean_shortcuts(ag)
|
||||
!
|
||||
! When requesting smoothed aggregation we cannot use the
|
||||
@@ -212,14 +207,12 @@ subroutine amg_d_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='Inner aggrmat asb')
|
||||
goto 9999
|
||||
end if
|
||||
#endif
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
contains
|
||||
subroutine clean_shortcuts(ag)
|
||||
@@ -248,5 +241,4 @@ contains
|
||||
end if
|
||||
end if
|
||||
end subroutine clean_shortcuts
|
||||
#endif
|
||||
end subroutine amg_d_parmatch_aggregator_mat_bld
|
||||
|
||||
@@ -47,11 +47,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_aggregator_build_tprol
|
||||
#endif
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
class(amg_d_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -88,7 +84,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
type(psb_ldspmat_type) :: tmp_prol, tmp_pg, tmp_restr
|
||||
type(psb_desc_type) :: tmp_desc_ac, tmp_desc_ax, tmp_desc_p
|
||||
integer(psb_ipk_), save :: idx_mboxp=-1, idx_spmmbld=-1, idx_sweeps_mult=-1
|
||||
logical, parameter :: dump=.false., do_timings=.true., debug=.false., &
|
||||
logical, parameter :: dump=.false., do_timings=.false., debug=.false., &
|
||||
& dump_prol_restr=.false.
|
||||
|
||||
name='d_parmatch_tprol'
|
||||
@@ -120,8 +116,6 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
|
||||
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
match_algorithm = ag%matching_alg
|
||||
n_sweeps = ag%n_sweeps
|
||||
if (2**n_sweeps /= ag%orig_aggr_size) then
|
||||
@@ -466,7 +460,7 @@ subroutine amg_d_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='amg_bootCMatch_if')
|
||||
goto 9999
|
||||
end if
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -110,11 +110,7 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
use amg_d_base_aggregator_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_smth_bld
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
@@ -194,8 +190,6 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
|
||||
if (do_timings) call psb_tic(idx_phase1)
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
naggr = nlaggr(me+1)
|
||||
ntaggr = sum(nlaggr)
|
||||
naggrm1 = sum(nlaggr(1:me))
|
||||
@@ -403,7 +397,7 @@ subroutine amg_d_parmatch_smth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done smooth_aggregate '
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_d_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
@@ -140,7 +136,6 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
call a%cp_to(acsr)
|
||||
|
||||
call amg_d_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
|
||||
@@ -154,7 +149,7 @@ subroutine amg_d_parmatch_spmm_bld(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done spmm_bld '
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_d_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld_inner
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
@@ -131,7 +127,7 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
& nzt, naggrm1, naggrp1, i, k
|
||||
integer(psb_lpk_), allocatable :: ia(:),ja(:)
|
||||
!integer(psb_lpk_) :: nrsave, ncsave, nzsave, nza, nrpsave, ncpsave, nzpsave
|
||||
logical, parameter :: do_timings=.true., oldstyle=.false., debug=.false.
|
||||
logical, parameter :: do_timings=.false., oldstyle=.false., debug=.false.
|
||||
integer(psb_ipk_), save :: idx_spspmm=-1, idx_prolcnv=-1, idx_proltrans=-1, idx_asb=-1
|
||||
|
||||
name='amg_parmatch_spmm_bld_inner'
|
||||
@@ -139,7 +135,6 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
info=psb_success_
|
||||
call psb_erractionsave(err_act)
|
||||
|
||||
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt, me, np)
|
||||
debug_unit = psb_get_debug_unit()
|
||||
@@ -163,7 +158,6 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
naggrm1 = sum(nlaggr(1:me))
|
||||
naggrp1 = sum(nlaggr(1:me+1))
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
!
|
||||
! Here T_PROL should be arriving with GLOBAL indices on the cols
|
||||
! and LOCAL indices on the rows.
|
||||
@@ -203,11 +197,10 @@ subroutine amg_d_parmatch_spmm_bld_inner(a_csr,desc_a,ilaggr,nlaggr,parms,&
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done smooth_aggregate '
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -99,11 +99,7 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
& ac,desc_ac,op_prol,op_restr,t_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_d_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_spmm_bld_ov
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
@@ -141,8 +137,6 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
call a%mv_to(acsr)
|
||||
|
||||
call amg_d_parmatch_spmm_bld_inner(acsr,desc_a,ilaggr,nlaggr,parms,&
|
||||
@@ -158,7 +152,6 @@ subroutine amg_d_parmatch_spmm_bld_ov(a,desc_a,ilaggr,nlaggr,parms,&
|
||||
if (debug_level >= psb_debug_outer_) &
|
||||
& write(debug_unit,*) me,' ',trim(name),&
|
||||
& 'Done spmm_bld '
|
||||
#endif
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -109,11 +109,7 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
use amg_d_base_aggregator_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_d_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_d_parmatch_aggregator_mod, amg_protect_name => amg_d_parmatch_unsmth_bld
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
! Arguments
|
||||
@@ -168,7 +164,6 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
nglob = desc_a%get_global_rows()
|
||||
nrow = desc_a%get_local_rows()
|
||||
ncol = desc_a%get_local_cols()
|
||||
@@ -209,7 +204,8 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
call op_prol%mv_from(coo_prol)
|
||||
|
||||
if (debug) write(0,*) me,' ',trim(name),' After mv_from',psb_get_errstatus()
|
||||
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
|
||||
if (debug) write(0,*) me,' ',trim(name),' ',ac%get_fmt(),ac%get_nrows(),&
|
||||
& ac%get_ncols(),ac%get_nzeros(),naggr,ntaggr
|
||||
! write(0,*) me,' ',trim(name),' Final AC newstyle ',ac%get_fmt(),ac%get_nrows(),ac%get_ncols(),ac%get_nzeros()
|
||||
|
||||
if (debug) then
|
||||
@@ -236,7 +232,6 @@ subroutine amg_d_parmatch_unsmth_bld(dol1smoothing,ag,a,desc_a,ilaggr,nlaggr,&
|
||||
goto 9999
|
||||
end if
|
||||
|
||||
#endif
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ subroutine amg_d_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
@@ -420,6 +421,7 @@ subroutine amg_d_ld_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
@@ -486,7 +488,7 @@ subroutine amg_ld_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
integer(psb_lpk_) :: nrow, nglob, ncol, ntaggr, nrl, nzl, ip, &
|
||||
& nzt, naggrm1, naggrp1, i, k
|
||||
integer(psb_lpk_) :: nrsave, ncsave, nzsave, nza
|
||||
logical, parameter :: do_timings=.true., oldstyle=.false., debug=.false.
|
||||
logical, parameter :: do_timings=.false., oldstyle=.false., debug=.false.
|
||||
integer(psb_ipk_), save :: idx_spspmm=-1
|
||||
|
||||
name='amg_ptap_bld'
|
||||
@@ -629,6 +631,7 @@ subroutine amg_ld_ptap_bld(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ subroutine amg_d_rap(a_csr,desc_a,nlaggr,parms,ac,&
|
||||
|
||||
call ac_csr%set_nrows(desc_ac%get_local_rows())
|
||||
call ac_csr%set_ncols(desc_ac%get_local_cols())
|
||||
call ac_csr%clean_zeros(info)
|
||||
call ac%mv_from(ac_csr)
|
||||
call ac%set_asb()
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
use omp_lib
|
||||
#endif
|
||||
implicit none
|
||||
@@ -103,7 +103,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
character(len=20) :: name, ch_err
|
||||
integer(psb_ipk_), save :: idx_soc1_p1=-1, idx_soc1_p2=-1, idx_soc1_p3=-1
|
||||
integer(psb_ipk_), save :: idx_soc1_p0=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
info=psb_success_
|
||||
name = 'amg_soc1_map_bld'
|
||||
@@ -172,7 +172,7 @@ subroutine amg_d_soc1_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
! Phase one: Start with disjoint groups.
|
||||
!
|
||||
naggr = 0
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
block
|
||||
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
|
||||
integer(psb_ipk_) :: myth,nths, kk
|
||||
|
||||
@@ -71,7 +71,7 @@ subroutine amg_d_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
use omp_lib
|
||||
#endif
|
||||
|
||||
@@ -104,7 +104,7 @@ subroutine amg_d_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
character(len=20) :: name, ch_err
|
||||
integer(psb_ipk_), save :: idx_soc2_p1=-1, idx_soc2_p2=-1, idx_soc2_p3=-1
|
||||
integer(psb_ipk_), save :: idx_soc2_p0=-1
|
||||
logical, parameter :: do_timings=.true.
|
||||
logical, parameter :: do_timings=.false.
|
||||
|
||||
info=psb_success_
|
||||
name = 'amg_soc2_map_bld'
|
||||
@@ -211,7 +211,7 @@ subroutine amg_d_soc2_map_bld(iorder,theta,clean_zeros,a,desc_a,nlaggr,ilaggr,in
|
||||
! Phase one: Start with disjoint groups.
|
||||
!
|
||||
naggr = 0
|
||||
#if defined(OPENMP)
|
||||
#if defined(PSB_OPENMP)
|
||||
block
|
||||
integer(psb_ipk_), allocatable :: bnds(:), locnaggr(:)
|
||||
integer(psb_ipk_) :: myth,nths, kk
|
||||
|
||||
@@ -80,7 +80,7 @@ subroutine amg_d_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
& a,desc_a,ilaggr,nlaggr,op_prol,info)
|
||||
use psb_base_mod
|
||||
use amg_d_prec_type
|
||||
use amg_d_symdec_aggregator_mod, amg_protect_name => amg_d_symdec_aggregator_build_tprol
|
||||
use amg_d_symdec_aggregator_mod, only : amg_d_symdec_aggregator_type
|
||||
use amg_d_inner_mod
|
||||
implicit none
|
||||
class(amg_d_symdec_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -103,6 +103,16 @@ subroutine amg_d_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
integer(psb_ipk_) :: debug_level, debug_unit
|
||||
logical :: clean_zeros
|
||||
|
||||
!!$ interface
|
||||
!!$ subroutine psb_daplusat(ain,aout,info)
|
||||
!!$ use psb_d_mat_mod, only : psb_dspmat_type
|
||||
!!$ import :: psb_ipk_
|
||||
!!$ implicit none
|
||||
!!$ type(psb_dspmat_type) :: ain, aout
|
||||
!!$ integer(psb_ipk_) :: info
|
||||
!!$ end subroutine psb_daplusat
|
||||
!!$ end interface
|
||||
!!$
|
||||
name='amg_d_symdec_aggregator_tprol'
|
||||
call psb_erractionsave(err_act)
|
||||
if (psb_errstatus_fatal()) then
|
||||
@@ -123,15 +133,11 @@ subroutine amg_d_symdec_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',dzero,is_legal_d_aggr_thrs)
|
||||
|
||||
nr = a%get_nrows()
|
||||
call a%csclip(atmp,info,imax=nr,jmax=nr,&
|
||||
call a%csclip(atrans,info,imax=nr,jmax=nr,&
|
||||
& rscale=.false.,cscale=.false.)
|
||||
call atmp%set_nrows(nr)
|
||||
call atmp%set_ncols(nr)
|
||||
if (info == psb_success_) call atmp%transp(atrans)
|
||||
if (info == psb_success_) call atrans%cscnv(info,type='COO')
|
||||
if (info == psb_success_) call psb_rwextd(nr,atmp,info,b=atrans,rowscale=.false.)
|
||||
call atmp%set_nrows(nr)
|
||||
call atmp%set_ncols(nr)
|
||||
call atrans%set_nrows(nr)
|
||||
call atrans%set_ncols(nr)
|
||||
call psb_aplusat(atrans,atmp,info)
|
||||
if (info == psb_success_) call atrans%free()
|
||||
if (info == psb_success_) call atmp%cscnv(info,type='CSR')
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
use amg_base_prec_type
|
||||
use amg_d_inner_mod, amg_protect_name => amg_daggrmat_smth_bld
|
||||
use amg_d_base_aggregator_mod
|
||||
! use, intrinsic :: ieee_arithmetic
|
||||
|
||||
implicit none
|
||||
|
||||
@@ -192,7 +193,7 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
|
||||
naggrm1 = sum(nlaggr(1:me))
|
||||
naggrp1 = sum(nlaggr(1:me+1))
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_)
|
||||
filter_mat = (parms%aggr_filter == amg_filter_mat_).or.(parms%aggr_filter == amg_filter_prow_mat_)
|
||||
|
||||
!
|
||||
! naggr: number of local aggregates
|
||||
@@ -220,7 +221,7 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
! \tilde{D}_{i,i} = \sum_{j \ne i} |a_{i,j}|
|
||||
!$OMP parallel do private(i) schedule(static)
|
||||
do i=1,size(adiag)
|
||||
adiag(i) = adiag(i) + l1rwsum(i) - abs(adiag(i))
|
||||
adiag(i) = adiag(i) + l1rwsum(i) - abs(adiag(i))
|
||||
end do
|
||||
!$OMP end parallel do
|
||||
end if
|
||||
@@ -257,8 +258,13 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
if (jd == -1) then
|
||||
! if (.not.do_l1correction)
|
||||
write(0,*) 'Wrong input: we need the diagonal!!!!', i
|
||||
else
|
||||
else if (parms%aggr_filter == amg_filter_mat_) then
|
||||
! We perform filtering in the standard way assuming that A is an M-matrix
|
||||
acsrf%val(jd)=acsrf%val(jd)-tmp
|
||||
else if (parms%aggr_filter == amg_filter_prow_mat_) then
|
||||
! We are probably doing l1-correction, hence we want to preserve the
|
||||
! row sum of the matrix: note the change in sign
|
||||
acsrf%val(jd)=acsrf%val(jd)+tmp
|
||||
end if
|
||||
enddo
|
||||
!$OMP end parallel do
|
||||
@@ -266,7 +272,6 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
call acsrf%clean_zeros(info)
|
||||
end if
|
||||
|
||||
|
||||
!$OMP parallel do private(i) schedule(static)
|
||||
do i=1,size(adiag)
|
||||
if (adiag(i) /= dzero) then
|
||||
@@ -278,11 +283,11 @@ subroutine amg_daggrmat_smth_bld(dol1smoothing,a,desc_a,ilaggr,nlaggr,&
|
||||
!$OMP end parallel do
|
||||
if (parms%aggr_omega_alg == amg_eig_est_) then
|
||||
|
||||
!if (do_l1correction) then
|
||||
! ! For l1-Jacobi this can be estimated with 1
|
||||
! parms%aggr_omega_val = done
|
||||
!
|
||||
if (parms%aggr_eig == amg_max_norm_) then
|
||||
if ( (parms%aggr_filter == amg_filter_prow_mat_).and.(do_l1correction) ) then
|
||||
! For l1-Jacobi this can be estimated with 1:
|
||||
! this makes sense only if we are preserving the row-sum!
|
||||
parms%aggr_omega_val = done
|
||||
else if (parms%aggr_eig == amg_max_norm_) then
|
||||
allocate(arwsum(nrow))
|
||||
call acsr%arwsum(arwsum)
|
||||
anorm = maxval(abs(adiag(1:nrow)*arwsum(1:nrow)))
|
||||
|
||||
@@ -98,11 +98,7 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
& ac,desc_ac, op_prol,op_restr,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_inner_mat_asb
|
||||
#endif
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
@@ -133,8 +129,6 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
if (debug) write(0,*) me,' ',trim(name),' Start:',&
|
||||
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
|
||||
|
||||
@@ -146,16 +140,17 @@ subroutine amg_s_parmatch_aggregator_inner_mat_asb(ag,parms,a,desc_a,&
|
||||
case(amg_repl_mat_)
|
||||
!
|
||||
!
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
|
||||
goto 9999
|
||||
|
||||
if (np>1) then
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='no repl coarse_mat_ here')
|
||||
goto 9999
|
||||
end if
|
||||
case default
|
||||
info = psb_err_internal_error_
|
||||
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
|
||||
goto 9999
|
||||
end select
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -98,11 +98,7 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
& ac,desc_ac, op_prol,op_restr,info)
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_mat_asb
|
||||
#endif
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
type(amg_sml_parms), intent(inout) :: parms
|
||||
@@ -112,7 +108,7 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
type(psb_desc_type), intent(inout) :: desc_ac
|
||||
integer(psb_ipk_), intent(out) :: info
|
||||
!
|
||||
type(psb_ctxt_type) :: ictxt
|
||||
type(psb_ctxt_type) :: ctxt
|
||||
integer(psb_ipk_) :: np, me
|
||||
type(psb_ls_coo_sparse_mat) :: tmpcoo
|
||||
type(psb_lsspmat_type) :: tmp_ac
|
||||
@@ -128,15 +124,13 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
debug_unit = psb_get_debug_unit()
|
||||
debug_level = psb_get_debug_level()
|
||||
info = psb_success_
|
||||
ictxt = desc_a%get_context()
|
||||
call psb_info(ictxt,me,np)
|
||||
ctxt = desc_a%get_context()
|
||||
call psb_info(ctxt,me,np)
|
||||
if (psb_get_errstatus().ne.0) then
|
||||
write(0,*) me,' From:',trim(name),':',psb_get_errstatus()
|
||||
return
|
||||
end if
|
||||
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
if (debug) write(0,*) me,' ',trim(name),' Start:',&
|
||||
& allocated(ag%ac),allocated(ag%desc_ac), allocated(ag%prol),allocated(ag%restr)
|
||||
|
||||
@@ -169,22 +163,21 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
call op_prol%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
call psb_loc_to_glob(tmpcoo%ja(1:nzl),desc_ac,info,'I')
|
||||
call tmpcoo%set_ncols(i_nr)
|
||||
call op_prol%mv_from(tmpcoo)
|
||||
|
||||
call op_restr%mv_to(tmpcoo)
|
||||
nzl = tmpcoo%get_nzeros()
|
||||
call psb_loc_to_glob(tmpcoo%ia(1:nzl),desc_ac,info,'I')
|
||||
call tmpcoo%set_nrows(i_nr)
|
||||
call op_restr%mv_from(tmpcoo)
|
||||
|
||||
call op_prol%set_ncols(i_nr)
|
||||
call op_restr%set_nrows(i_nr)
|
||||
|
||||
call psb_gather(tmp_ac,ac,desc_ac,info,root=-ione,&
|
||||
& dupl=psb_dupl_add_,keeploc=.false.)
|
||||
call tmp_ac%mv_to(tmpcoo)
|
||||
call ac%mv_from(tmpcoo)
|
||||
|
||||
call psb_cdall(ictxt,desc_ac,info,mg=ntaggr,repl=.true.)
|
||||
call psb_cdall(ctxt,desc_ac,info,mg=ntaggr,repl=.true.)
|
||||
if (info == psb_success_) call psb_cdasb(desc_ac,info)
|
||||
!
|
||||
! Now that we have the descriptors and the restrictor, we should
|
||||
@@ -199,7 +192,7 @@ subroutine amg_s_parmatch_aggregator_mat_asb(ag,parms,a,desc_a,&
|
||||
call psb_errpush(info,name,a_err='invalid amg_coarse_mat_')
|
||||
goto 9999
|
||||
end select
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
@@ -135,11 +135,7 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
use psb_base_mod
|
||||
use amg_s_inner_mod
|
||||
use amg_base_prec_type
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_mat_bld
|
||||
#endif
|
||||
implicit none
|
||||
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -176,7 +172,6 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
! algorithm specified by
|
||||
!
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
call clean_shortcuts(ag)
|
||||
!
|
||||
! When requesting smoothed aggregation we cannot use the
|
||||
@@ -212,14 +207,12 @@ subroutine amg_s_parmatch_aggregator_mat_bld(ag,parms,a,desc_a,ilaggr,nlaggr,&
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='Inner aggrmat asb')
|
||||
goto 9999
|
||||
end if
|
||||
#endif
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
9999 call psb_error_handler(err_act)
|
||||
return
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
contains
|
||||
subroutine clean_shortcuts(ag)
|
||||
@@ -248,5 +241,4 @@ contains
|
||||
end if
|
||||
end if
|
||||
end subroutine clean_shortcuts
|
||||
#endif
|
||||
end subroutine amg_s_parmatch_aggregator_mat_bld
|
||||
|
||||
@@ -47,11 +47,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
use psb_base_mod
|
||||
use amg_base_prec_type
|
||||
use amg_s_inner_mod
|
||||
#if defined(SERIAL_MPI)
|
||||
use amg_s_parmatch_aggregator_mod
|
||||
#else
|
||||
use amg_s_parmatch_aggregator_mod, amg_protect_name => amg_s_parmatch_aggregator_build_tprol
|
||||
#endif
|
||||
use iso_c_binding
|
||||
implicit none
|
||||
class(amg_s_parmatch_aggregator_type), target, intent(inout) :: ag
|
||||
@@ -88,7 +84,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
type(psb_lsspmat_type) :: tmp_prol, tmp_pg, tmp_restr
|
||||
type(psb_desc_type) :: tmp_desc_ac, tmp_desc_ax, tmp_desc_p
|
||||
integer(psb_ipk_), save :: idx_mboxp=-1, idx_spmmbld=-1, idx_sweeps_mult=-1
|
||||
logical, parameter :: dump=.false., do_timings=.true., debug=.false., &
|
||||
logical, parameter :: dump=.false., do_timings=.false., debug=.false., &
|
||||
& dump_prol_restr=.false.
|
||||
|
||||
name='s_parmatch_tprol'
|
||||
@@ -120,8 +116,6 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
& amg_aggr_ord_nat_,is_legal_ml_aggr_ord)
|
||||
call amg_check_def(parms%aggr_thresh,'Aggr_Thresh',szero,is_legal_s_aggr_thrs)
|
||||
|
||||
#if !defined(SERIAL_MPI)
|
||||
|
||||
match_algorithm = ag%matching_alg
|
||||
n_sweeps = ag%n_sweeps
|
||||
if (2**n_sweeps /= ag%orig_aggr_size) then
|
||||
@@ -466,7 +460,7 @@ subroutine amg_s_parmatch_aggregator_build_tprol(ag,parms,ag_data,&
|
||||
call psb_errpush(psb_err_from_subroutine_,name,a_err='amg_bootCMatch_if')
|
||||
goto 9999
|
||||
end if
|
||||
#endif
|
||||
|
||||
call psb_erractionrestore(err_act)
|
||||
return
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user