73 Commits
Author SHA1 Message Date
Sylvestre Ledru 9233f7f86f cosmetic changes on the changelog 2017-05-16 11:47:12 +02:00
Sylvestre Ledru 81ef2f1a54 Fix the wrong changelog 2017-05-15 14:25:07 +02:00
Sylvestre Ledru 5705571117 Prepare 3.5.0 release 2017-05-15 14:23:29 +02:00
Sylvestre Ledru c7bd8e70bc Fix the position in the CHANGES file 2017-05-15 14:16:31 +02:00
Ondřej Čertík 2279a76924 Fix a typo: commuication -> communication (#60) 2017-05-15 14:13:16 +02:00
caliarim 26e31ba431 Test for issue #58 (#59)
* Avoid purification stage in [d,s]neupd.f if it requires division by zero (Closes: #58)
2017-05-15 14:13:02 +02:00
turboencabulator 0e2ed1b2f2 Improvements to configure.ac (#52)
* Add the --with-pkgconfigdir option

* Ignore more autoreconf-generated files

* Various portability improvements

Use the 2nd argument to AX_BLAS and AX_LAPACK to handle errors.  Don't
rely on $ax_blas_ok and $ax_lapack_ok having any particular value.

AC_ARG_ENABLE([x], ...) will define $enable_x to $enableval.  No need to
do this ourselves.

The default for $enable_mpi is "no", so only compare to "no".

* Add gitignore patterns for files generated by test-driver

* Add a workaround for those without pkg-config >= 0.27

* Update CHANGES
2017-03-29 16:35:22 +02:00
turboencabulator 9631eb8b5f Improvements to CMake (#53)
* Automatically determine installation locations

* Set the library version to match the autotools build

* First attempt at generating arpack.pc from CMake

* Update CHANGES
2016-12-16 09:59:38 +01:00
Sylvestre Ledru b16d8700a8 Merge branch 'master' of github.com:opencollab/arpack-ng 2016-09-20 17:53:42 +02:00
Sylvestre Ledru 747a7d811f we also have a testsuite, show it in the README 2016-09-20 08:25:39 +02:00
Sergei Iskakov f9927db4cf Fix a potential deadlock when using custom communicators (Fix issue #46) (#48)
Fix a potential deadlock when using custom communicators (Fix issue #46) (#48)
2016-09-19 23:04:09 +02:00
matzeri 00a6affb9b removing AC_FC_LINE_LENGTH to solve #41 on Cygwin (#42)
* removing AC_FC_LINE_LENGTH to solve
https://github.com/opencollab/arpack-ng/issues/41
on Cygwin

* reimplementing AC_FC_LINE_LENGTH

* changelog entry for AC_PROG_FC usage
2016-09-19 08:07:28 +02:00
Sylvestre Ledru 7ec2f3e7e5 Merge pull request #43 from vtjnash/jn/intel-fix
fix usages of DLACPY to not alias inputs
2016-09-14 18:37:42 +02:00
Jameson Nash fdbf8ffe98 Update CHANGES 2016-09-14 12:37:08 -04:00
Sylvestre Ledru eaeaebbc7d Merge pull request #47 from jschueller/patch-1
Update CHANGES
2016-09-14 13:36:50 +02:00
Julien Schueller bbf870f3e7 Update CHANGES 2016-09-14 12:09:08 +02:00
Sylvestre Ledru 6aeef41c11 Merge pull request #45 from jschueller/patch-1
Disable C++ compiler detection
2016-09-13 19:27:46 +02:00
Julien Schueller 1b42f88e11 Add a comment about cmp0042 2016-09-13 19:23:06 +02:00
Julien Schueller b0e2a14258 Set policy CMP0042 2016-09-13 17:50:55 +02:00
Julien Schueller b8aa09a548 Disable C++ 2016-09-13 16:42:37 +02:00
Jameson Nash b4ed4cadd1 Update CHANGES 2016-09-05 17:21:17 -04:00
Zhang Z. (Intel) 3c6c210dc4 fix usage of DLACPY to not alias inputs
https://software.intel.com/en-us/articles/how-to-resolve-arpack-issues-with-intel-mkl-110-update-3
2016-08-08 17:36:34 -04:00
Sylvestre Ledru 08a6349ff7 remove an old email address for Allan 2016-07-28 11:37:23 +02:00
Sylvestre Ledru 4a3502b11f Merge pull request #39 from davydden/fix/cmake
Improve cmake build
2016-07-25 12:32:31 +02:00
Denis Davydov d1cd023783 cmake: whitespaces 2016-07-06 14:28:21 +02:00
Denis Davydov 70a97f8f22 add an antry in change and improve readme 2016-07-06 13:13:49 +02:00
Denis Davydov a9ab2a11af cmake: add missing dependency of parpack on arpack 2016-07-06 13:12:42 +02:00
Denis Davydov cc2466c635 cmake: add install targets 2016-07-06 13:12:42 +02:00
Sylvestre Ledru a3ce584000 occured => occurred 2016-07-03 11:07:35 +02:00
Sylvestre Ledru 894faaa243 prepare a new version 2016-07-02 21:54:15 +02:00
Sylvestre Ledru 54f244612e Update the date for release 2016-07-02 21:52:15 +02:00
Sylvestre Ledru bdaab9995a cosmetic 2016-07-02 21:51:41 +02:00
Sylvestre Ledru d66b8b4b0a Merge pull request #35 from davydden/pdlamch10_return
fix pdlamch10 return variable
2016-03-14 14:07:51 +01:00
Denis Davydov 56e6e9f763 fix pdlamch10 return variable 2016-03-14 07:21:40 +01:00
Sylvestre Ledru b55cc59146 Merge the two changelog items. 3.4.0 hasn't been released yet 2016-02-15 14:40:06 +01:00
Sylvestre Ledru a0b3de6b82 Merge pull request #32 from nalimilan/suffix
ILP64 support
2016-02-15 14:38:38 +01:00
Milan Bouchet-Valat a97e5c53b4 Update changelog 2016-01-25 14:37:45 +01:00
Milan Bouchet-Valat 0e19885160 Add CMake support 2016-01-25 14:23:32 +01:00
Milan Bouchet-Valat 69ff75af05 Improve portability by using more autoconf macros 2016-01-25 14:23:29 +01:00
Milan Bouchet-Valat 5f47b8df2e Support building with ILP64 interface
This adds a configure variable INTERFACE64 which changes the integer
size to 64 bits for ARPACK as well as BLAS and LAPACK. The tests are
also updated to use a BLASINT type reflecting the BLAS integer.
2016-01-25 13:47:43 +01:00
Milan Bouchet-Valat f4f5173864 Support adding suffix to ARPACK, BLAS and LAPACK names
This adds three configure variables:
- LIBSUFFIX to add a suffix to the ARPACK library name
- SYMBOLSUFFIX to add a suffix to ARPACK, BLAS and LAPACK symbol names
2016-01-25 13:47:43 +01:00
Sylvestre Ledru c9ace29448 Merge pull request #31 from turboencabulator/autotools-fixes
Autotools fixes
2016-01-20 16:20:07 +01:00
Kyle Guinn 86df5b062e Follow autoconf's error message style suggestions
"The error-description should start with a lower-case letter"
2016-01-08 01:45:31 -06:00
Kyle Guinn 7fc73aae63 Delete an AC_MSG_CHECKING without a corresponding AC_MSG_RESULT
This is meant to be used around something like AC_TRY_COMPILE.  The
ax_mpi.m4 script will print out several similar lines, so there's no
need to convert it to AC_MSG_NOTICE.
2016-01-08 01:39:46 -06:00
Kyle Guinn 1131e093af Simplify MPI/BLACS selection
Set up the BLACS variant to install libparpack and build examples just
like the MPI variant.  You can now choose one of the two from
configure.ac.  The BLACS variant is disabled for now.  Because it is
disabled, note that the sources are no longer built and then left
unused.
2016-01-08 01:08:43 -06:00
Kyle Guinn c6e5122c8e Remove another libtool convenience library
Repeats the last commit on the PARPACK sources.
2016-01-08 00:54:41 -06:00
Kyle Guinn 3d94a2cd3d Remove a libtool convenience library
Instead of creating a convenience lib of everything in SRC and linking
it in the root directory, create the actual libarpack library in SRC
instead.
2016-01-08 00:40:46 -06:00
Kyle Guinn d8f2020144 Shorten the names of some targets
Let the directory name distinguish between BLACS and MPI variants.
2016-01-07 00:32:32 -06:00
Kyle Guinn 33a3efd6ee Remove test-dnsimp.sh
AC_CONFIG_LINKS copies testA.mtx to the build directory, making this
script unnecessary.
2016-01-06 22:47:58 -06:00
Kyle Guinn ddfd843e29 Do not link bug_1315 tests to LAPACK/BLAS
LAPACK/BLAS is not a direct dependency.  If it was, we would also need
to link with $(FLIBS) as determined by AC_F77_LIBRARY_LDFLAGS since
we're mixing C and Fortran.
2016-01-06 22:44:28 -06:00
Kyle Guinn 29e06320f6 Remove AM_DEFAULT_SOURCE_EXT
Each executable has a _SOURCES variable defined.  No need for automake
to guess a default value for _SOURCES.
2016-01-06 22:42:32 -06:00
Kyle Guinn e8267ce709 Fix order of BLAS/LAPACK libraries 2016-01-04 22:41:00 -06:00
Sylvestre Ledru 337ab26e85 Update the version to 3.4.0 2015-10-27 10:22:31 +01:00
Sylvestre Ledru 01b5490e68 Describe Martin's change with cmake 2015-10-27 10:19:50 +01:00
Sylvestre Ledru 30a3e266e4 also ship CMakeLists.txt with the autotool build system 2015-10-27 10:19:37 +01:00
Sylvestre Ledru a3379944dc Merge pull request #26 from m-reuter/master
Add the cmake build support
2015-10-21 10:16:23 +02:00
Martin Reuter 5a16aaf287 Added cmake check to travis 2015-10-20 23:46:32 -04:00
Martin Reuter f0c4d81627 Added checks to cmake 2015-10-20 23:43:54 -04:00
Martin Reuter cdbce13db0 Added Cmake info 2015-10-20 16:58:20 -04:00
Sylvestre Ledru 08cea42566 Merge pull request #27 from thrasibule/use_blasref
Try to use reference blas to avoid a random issue in test bug_1315
2015-10-19 22:12:06 +02:00
Sylvestre Ledru 99ef033832 Merge pull request #28 from thrasibule/missing_free
Add missing free in a test
2015-10-19 22:09:44 +02:00
Guillaume Horel 6a6f8528cd add missing free 2015-10-19 14:43:29 -04:00
Guillaume Horel 0704e64ff4 try to use reference blas 2015-10-19 14:30:27 -04:00
Martin Reuter 7bbfb50ad7 cmake project name revert 2015-10-15 16:41:58 -04:00
Martin Reuter 639e42a5ca cmake project name should be arpack-ng 2015-10-15 16:33:43 -04:00
Martin Reuter 5e0617f859 Cmake change library order 2015-10-15 16:12:58 -04:00
Martin Reuter e511e06a33 fix directory names in CMake 2015-10-15 15:54:00 -04:00
Martin Reuter 664123a8d6 adding MPI to cmake for travis 2015-10-15 15:44:17 -04:00
Martin Reuter ceda2ef405 fix: now using BUILD env var 2015-10-15 15:42:26 -04:00
Martin Reuter 6c859f2e67 adding EXAMPLES to cmake travis 2015-10-15 15:39:00 -04:00
Martin Reuter db90ad5881 adding CMAKE to travis (parallel) 2015-10-15 15:12:13 -04:00
Martin Reuter 8f020e2715 force external Lapack and BLAS and adjust local dir names to upper case 2015-10-14 15:46:04 -04:00
Martin Reuter 16b445ec08 Adopted Cmake from https://github.com/feymark/arpack.git 2015-10-14 15:46:04 -04:00
65 changed files with 1946 additions and 278 deletions
+4
View File
@@ -6,6 +6,7 @@ aclocal.m4
autom4te.cache/
m4/libtool.m4
m4/lt*.m4
compile
configure
config.guess
config.sub
@@ -13,6 +14,7 @@ depcomp
install-sh
ltmain.sh
missing
test-driver
# Generated by `./configure`
Makefile
@@ -29,6 +31,8 @@ arpack.pc
.libs/
# Generated by `make check`
*.log
*.trs
TESTS/dnsimp
TESTS/bug_1315_double
TESTS/bug_1315_single
+18 -6
View File
@@ -9,14 +9,26 @@ addons:
apt:
packages:
- gfortran
- libopenblas-dev
- libblas-dev
- liblapack-dev
- libopenmpi-dev
- openmpi-bin
env:
- BUILD=cmake
- BUILD=configure
before_script:
- if [ "$BUILD" == "cmake" ]; then mkdir build ; fi
- if [ "$BUILD" == "cmake" ]; then cd build ; fi
- if [ "$BUILD" == "cmake" ]; then cmake -D EXAMPLES=ON -D MPI=ON .. ; fi
script:
- ./bootstrap
- ./configure --enable-mpi
- make all
- make check
- make distcheck
# CMAKE
- if [ "$BUILD" == "cmake" ]; then make all check ; fi
# CONFIGURE
- if [ "$BUILD" == "configure" ]; then ./bootstrap ; fi
- if [ "$BUILD" == "configure" ]; then ./configure --enable-mpi ; fi
- if [ "$BUILD" == "configure" ]; then make all ; fi
- if [ "$BUILD" == "configure" ]; then make check ; fi
- if [ "$BUILD" == "configure" ]; then make distcheck ; fi
+47 -1
View File
@@ -1,4 +1,50 @@
arpack-ng - 3.5.0
[ Julien Schueller ]
* Improve cmake build system: disable C++ detection, set default build type.
[ Marco Atzeri]
* Use AC_PROG_FC instead of AC_PROG_F77 for proper inizialization
for the usage of AC_FC_LINE_LENGTH. Noted on Cygwin.
[ Denis Davydov ]
* Improve cmake build system: add make install and fix shared libraries.
[ Zhang Z ]
* fix usages of DLACPY to not alias inputs
(patch from https://software.intel.com/en-us/articles/how-to-resolve-arpack-issues-with-intel-mkl-110-update-3)
[ Iskakov Sergei ]
* Fix possible deadlock when PARPACK call uses communicator with a larger
number of CPUs than previous call
[ Kyle Guinn ]
* Portability improvements to the autotools build system.
* Let cmake guess the default installation directories. Can be
overridden by changing CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_BINDIR.
* Shared libraries built by cmake now have their SONAME set identical to
those built by autotools.
[ Marco Caliari ]
* Avoid purification stage in [d,s]neupd.f if it requires division
by zero (Closes: #58)
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 15 May 2017 14:21:48 +0200
arpack-ng - 3.4.0
[ Milan Bouchet-Valat ]
* Allow adding suffixes to symbols and library names to build ILP64 version
based on ILP64 BLAS/LAPACK with suffixes. This avoids conflicts when loading
libraries with different integer sizes in the same program.
[ Martin Reuter ]
* Add the support of cmake build system
-- Sylvestre Ledru <sylvestre@debian.org> Sat, 02 Jul 2016 21:51:52 +0200
arpack-ng - 3.3.0
[ Denis Davydov ]
* Rename pdlamch to pdlamch10 to avoid symbol collision with Scalapack 2.0.2 in MPI context.
@@ -6,7 +52,7 @@ arpack-ng - 3.3.0
* General improvements on the build system
* libparpack links against libarpack (instead of doing a static link)
[Guillaume Horel]
[ Guillaume Horel ]
* reverts using {d,s}lahqr from lapack 2
* use dlahqr from lapack 3 instead of dlaqrb (credit to Marco Caliari)
+446
View File
@@ -0,0 +1,446 @@
cmake_minimum_required(VERSION 2.8.6)
if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif ()
project(arpack C Fortran)
# Adopted from https://github.com/feymark/arpack.git
if (POLICY CMP0042)
# enable MACOSX_RPATH by default
cmake_policy (SET CMP0042 NEW)
endif ()
option(MPI "Enable parallel support" OFF)
#option(SYSTEM_BLAS "Use system BLAS" ON)
#option(SYSTEM_LAPACK "Use system LAPACK" ON)
option(EXAMPLES "Compile ARPACK examples" OFF)
set(LIBSUFFIX ""
CACHE STRING "suffix to add to ARPACK libraries names")
set(SYMBOLSUFFIX ""
CACHE STRING "suffix to add to ARPACK, BLAS and LAPACK function names")
option(INTERFACE64 "use the 64-bit integer interface (ILP64) for ARPACK, BLAS and LAPACK")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
function(prefixlist list_name prefix)
set(${list_name}_TMP)
foreach(l ${${list_name}})
list(APPEND ${list_name}_TMP ${prefix}${l} )
endforeach()
set(${list_name} "${${list_name}_TMP}" PARENT_SCOPE)
endfunction(prefixlist)
function(examples list_name)
foreach(l ${${list_name}})
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${arpackexample_DIR}/${l} ${examples_EXTRA_SRCS})
target_link_libraries(${lwe} arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
endforeach()
endfunction(examples)
function(pexamples list_name)
foreach(l ${${list_name}})
get_filename_component(lwe ${l} NAME_WE)
add_executable(${lwe} ${parpackexample_DIR}/${l} )
target_link_libraries(${lwe} parpack arpack ${MPI_Fortran_LIBRARIES})
endforeach()
endfunction(pexamples)
#if (SYSTEM_BLAS)
find_package(BLAS REQUIRED)
#endif()
#if (BLAS_LIBRARIES)
# set(SYSTEM_BLAS ON)
#endif()
if (MPI)
include(FindMPI)
find_package(MPI REQUIRED)
include_directories(${MPI_Fortran_INCLUDE_PATH})
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MPI_Fortran_COMPILE_FLAG}")
endif()
#if (SYSTEM_LAPACK)
find_package(LAPACK REQUIRED)
#endif()
#if (BLAS_LIBRARIES)
# set(SYSTEM_LAPACK ON)
#endif()
if (MPI)
set(parpackutil_DIR ${arpack_SOURCE_DIR}/PARPACK/UTIL/)
set(parpacksrc_DIR ${arpack_SOURCE_DIR}/PARPACK/SRC/)
endif()
#if (NOT SYSTEM_BLAS)
# file(GLOB arpackblas_STAT_SRCS blas/*.f)
#endif()
#if (NOT SYSTEM_LAPACK)
# file(GLOB arpacklapack_STAT_SRCS lapack/*.f)
#endif()
#file(GLOB arpackutil_STAT_SRCS util/*.f)
file(GLOB arpacksrc_STAT_SRCS SRC/*.f)
set(arpackutil_STAT_SRCS
UTIL/icnteq.f
UTIL/icopy.f
UTIL/iset.f
UTIL/iswap.f
UTIL/ivout.f
UTIL/second_NONE.f
UTIL/svout.f
UTIL/smout.f
UTIL/dvout.f
UTIL/dmout.f
UTIL/cvout.f
UTIL/cmout.f
UTIL/zvout.f
UTIL/zmout.f )
if (MPI)
file(GLOB parpackutil_STAT_SRCS PARPACK/UTIL/MPI/*.f)
file(GLOB parpacksrc_STAT_SRCS PARPACK/SRC/MPI/*.f)
endif()
#add_library(arpack SHARED
# ${arpackblas_STAT_SRCS}
# ${arpacklapack_STAT_SRCS}
# ${arpackutil_STAT_SRCS}
# ${arpacksrc_STAT_SRCS})
add_library(arpack
${arpackutil_STAT_SRCS}
${arpacksrc_STAT_SRCS})
target_link_libraries(arpack ${BLAS_LIBRARIES})
target_link_libraries(arpack ${LAPACK_LIBRARIES})
set_target_properties(arpack PROPERTIES OUTPUT_NAME arpack${LIBSUFFIX})
set_target_properties(arpack PROPERTIES VERSION 2.0.0)
set_target_properties(arpack PROPERTIES SOVERSION 2)
if (MPI)
# add_library(parpack SHARED
add_library(parpack
${parpacksrc_STAT_SRCS}
${parpackutil_STAT_SRCS})
target_link_libraries(parpack ${MPI_Fortran_LIBRARIES})
target_link_libraries(parpack arpack)
set_target_properties(parpack PROPERTIES OUTPUT_NAME parpack${LIBSUFFIX})
set_target_properties(parpack PROPERTIES VERSION 2.0.0)
set_target_properties(parpack PROPERTIES SOVERSION 2)
endif ()
if (INTERFACE64)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fdefault-integer-8")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -i8")
else ()
message(WARNING "build script does not know how to make your Fortran compiler use 64-bit integers: set it manually via FFLAGS.")
endif ()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBLASINT=int64_t")
endif ()
if (SYMBOLSUFFIX)
if ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -cpp -ffixed-line-length-none")
elseif ("${CMAKE_Fortran_COMPILER_ID}" MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp -extend-source")
else ()
message(WARNING "build script does not know how to enable your Fortran compiler's preprocessor and support for lines longer than 72 characters: set them manually via FFLAGS.")
endif ()
set(SCALARFUNS naitr napps naup2 naupd nconv neigh neupd ngets statn saitr sapps saup2 saupd sconv seigt seupd sgets stats getv0 sortc sortr sesrt stqrb)
set(COMPLEXFUNS, naitr napps naup2 naupd neigh neupd ngets statn getv0 sortc)
set(BLASFUNS1 axpy copy gemv geqr2 lacpy lae2 lahqr lanhs larnv lartg lascl laset lasrt scal trevc trmm trsen gbmv gbtrf gbtrs gttrf gttrs pttrf pttrs)
set(BLASFUNS2 dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap)
set(BLASFUNS3 dotc geru unm2r)
set(BLASFUNS4 COPY LABAD LAMCH LANHS LANV2 LARFG ROT GEMV)
set(BLASFUNS5 scnrm2 dznrm2 csscal zdscal)
foreach (f IN LISTS SCALARFUNS BLASFUNS1 BLASFUNS2)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Ds${f}=s${f}${SYMBOLSUFFIX} -Dd${f}=d${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS COMPLEXFUNS BLASFUNS1 BLASFUNS3)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Dc${f}=c${f}${SYMBOLSUFFIX} -Dz${f}=z${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS4)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DS${f}=S${f}${SYMBOLSUFFIX} -DD${f}=D${f}${SYMBOLSUFFIX}")
endforeach ()
foreach (f IN LISTS BLASFUNS5)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
endforeach ()
endif ()
set(CFUNS sgemm snaupd sneupd dnaupd dneupd cheev)
foreach (f IN LISTS CFUNS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${f}=${f}${SYMBOLSUFFIX}")
list(APPEND CFUNS_SUFFIXED ${f}${SYMBOLSUFFIX})
endforeach ()
include(FortranCInterface)
FortranCInterface_HEADER(FCMangle.h SYMBOLS ${CFUNS_SUFFIXED})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DINCLUDE_FCMANGLE")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
############################
# EXAMPLES
############################
if (EXAMPLES)
############################
# EXAMPLES/BAND
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/BAND/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/band/)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/cnband.f)
set(examples_STAT_SRCS
cnbdr1.f
cnbdr2.f
cnbdr3.f
cnbdr4.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/dnband.f)
set(examples_STAT_SRCS
dnbdr1.f
dnbdr2.f
dnbdr3.f
dnbdr4.f
dnbdr5.f
dnbdr6.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/dsband.f)
set(examples_STAT_SRCS
dsbdr1.f
dsbdr2.f
dsbdr3.f
dsbdr4.f
dsbdr5.f
dsbdr6.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/snband.f)
set(examples_STAT_SRCS
snbdr1.f
snbdr2.f
snbdr3.f
snbdr4.f
snbdr5.f
snbdr6.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/ssband.f)
set(examples_STAT_SRCS
ssbdr1.f
ssbdr2.f
ssbdr3.f
ssbdr4.f
ssbdr5.f
ssbdr6.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS ${arpackexample_DIR}/znband.f)
set(examples_STAT_SRCS
znbdr1.f
znbdr2.f
znbdr3.f
znbdr4.f)
examples(examples_STAT_SRCS)
set(examples_EXTRA_SRCS)
############################
# EXAMPLES/COMPLEX
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/COMPLEX/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/complex/)
set(examples_STAT_SRCS
cndrv1.f
cndrv2.f
cndrv3.f
cndrv4.f
zndrv1.f
zndrv2.f
zndrv3.f
zndrv4.f)
examples(examples_STAT_SRCS)
############################
# examples/nonsym
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/NONSYM/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/nonsym/)
set(examples_STAT_SRCS
dndrv1.f
dndrv2.f
dndrv3.f
dndrv4.f
dndrv5.f
dndrv6.f
sndrv1.f
sndrv2.f
sndrv3.f
sndrv4.f
sndrv5.f
sndrv6.f)
examples(examples_STAT_SRCS)
############################
# examples/SIMPLE
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/SIMPLE/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/simple/)
set(examples_STAT_SRCS
cnsimp.f
dnsimp.f
dssimp.f
snsimp.f
sssimp.f
znsimp.f)
examples(examples_STAT_SRCS)
############################
# examples/svd
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/SVD/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/svd/)
set(examples_STAT_SRCS
ssvd.f)
examples(examples_STAT_SRCS)
############################
# examples/sym
############################
set(arpackexample_DIR ${arpack_SOURCE_DIR}/EXAMPLES/SYM/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/sym/)
set(examples_STAT_SRCS
dsdrv1.f
dsdrv2.f
dsdrv3.f
dsdrv4.f
dsdrv5.f
dsdrv6.f
ssdrv1.f
ssdrv2.f
ssdrv3.f
ssdrv4.f
ssdrv5.f
ssdrv6.f)
examples(examples_STAT_SRCS)
############################
# parpack/examples
############################
if (MPI)
set(parpackexample_DIR ${arpack_SOURCE_DIR}/PARPACK/EXAMPLES/MPI/)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Examples/parpack)
set(pexamples_STAT_SRCS
pcndrv1.f
pdndrv1.f
pdndrv3.f
pdsdrv1.f
psndrv1.f
psndrv3.f
pssdrv1.f
pzndrv1.f)
pexamples(pexamples_STAT_SRCS)
endif()
endif()
############################
# CHECK
############################
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Tests)
add_executable(dnsimp_test EXCLUDE_FROM_ALL TESTS/dnsimp.f TESTS/mmio.f TESTS/debug.h)
set_target_properties( dnsimp_test PROPERTIES OUTPUT_NAME dnsimp )
target_link_libraries(dnsimp_test arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_custom_command(TARGET dnsimp_test POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/TESTS/testA.mtx testA.mtx
)
add_test(dnsimp_test Tests/dnsimp)
add_executable(bug_1315_single EXCLUDE_FROM_ALL TESTS/bug_1315_single.c)
target_link_libraries(bug_1315_single arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_test(bug_1315_single Tests/bug_1315_single)
add_executable(bug_1315_double EXCLUDE_FROM_ALL TESTS/bug_1315_double.c)
target_link_libraries(bug_1315_double arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_test(bug_1315_double Tests/bug_1315_double)
add_executable(bug_1323 EXCLUDE_FROM_ALL TESTS/bug_1323.f)
target_link_libraries(bug_1323 arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_test(bug_1323 Tests/bug_1323)
add_executable(bug_58_double EXCLUDE_FROM_ALL TESTS/bug_58_double.f)
target_link_libraries(bug_58_double arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_test(bug_58_double Tests/bug_58_double)
add_dependencies(check dnsimp_test bug_1315_single bug_1315_double bug_1323 bug_58_double)
if(MPI)
add_executable(issue46 PARPACK/TESTS/MPI/issue46.f)
target_link_libraries(issue46 parpack arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
add_test(issue46 Tests/issue46)
endif()
############################
# install
############################
# 'make install' to the correct location
include(GNUInstallDirs)
# Convert variable names to those expected by the .pc file.
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix \${prefix})
set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
set(PACKAGE_NAME ${PROJECT_NAME})
# TODO: Fill these in with something appropriate.
#set(PACKAGE_VERSION)
#set(PACKAGE_URL)
#set(LAPACK_LIBS)
#set(BLAS_LIBS)
configure_file(arpack.pc.in arpack${LIBSUFFIX}.pc @ONLY)
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/arpack${LIBSUFFIX}.pc
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(TARGETS arpack
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (MPI)
install(TARGETS parpack
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif ()
+2 -2
View File
@@ -219,7 +219,7 @@ c %---------------------------------%
of the Hessenberg matrix and their the corresponding
error bounds, KEV, NP.
mnapps > 0: *Print information about where deflation occured.
mnapps > 0: *Print information about where deflation occurred.
mnapps > 1: *Print sigmak, betak, order of the final Hessenberg matrix,
and the final compressed upper Hessenberg matrix.
mnapps > 2: *Print implicit application of shift number, real and imaginary
@@ -303,7 +303,7 @@ c %---------------------------------%
of the Hessenberg matrix and their the corresponding
error bounds, KEV, NP.
mcapps > 0: *Print information about where deflation occured.
mcapps > 0: *Print information about where deflation occurred.
mcapps > 1: *Print sigmak, betak, order of the final Hessenberg matrix,
and the final compressed upper Hessenberg matrix.
mcapps > 2: *Print implicit application of shift number, the shift.
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SSBDR = ssbdr1 ssbdr2 ssbdr3 ssbdr4 ssbdr5 ssbdr6
DSBDR = dsbdr1 dsbdr2 dsbdr3 dsbdr4 dsbdr5 dsbdr6
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
CNDRV = cndrv1 cndrv2 cndrv3 cndrv4
ZNDRV = zndrv1 zndrv2 zndrv3 zndrv4
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SNDRV = sndrv1 sndrv2 sndrv3 sndrv4 sndrv5 sndrv6
DNDRV = dndrv1 dndrv2 dndrv3 dndrv4 dndrv5 dndrv6
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SIMPLE = sssimp dssimp snsimp dnsimp cnsimp znsimp
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SVD = ssvd dsvd
+1 -1
View File
@@ -1,4 +1,4 @@
LDADD = $(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SSDRV = ssdrv1 ssdrv2 ssdrv3 ssdrv4 ssdrv5 ssdrv6
DSDRV = dsdrv1 dsdrv2 dsdrv3 dsdrv4 dsdrv5 dsdrv6
+5 -23
View File
@@ -1,32 +1,14 @@
SUBDIRS = UTIL SRC . TESTS EXAMPLES
ACLOCAL_AMFLAGS = -I m4
if MPI
SUBDIRS += PARPACK
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-mpi
endif
lib_LTLIBRARIES = libarpack.la
ACLOCAL_AMFLAGS = -I m4
libarpack_la_SOURCES =
# Force libarpack to be linked with the Fortran compiler.
# The file dummy.f does not need to exist in the source tree.
nodist_EXTRA_libarpack_la_SOURCES = dummy.f
libarpack_la_LDFLAGS = -no-undefined -version-info 2:0
libarpack_la_LIBADD = \
$(top_builddir)/SRC/libarpacksrc.la \
$(top_builddir)/UTIL/libarpackutil.la \
$(LAPACK_LIBS) $(BLAS_LIBS)
SUBDIRS = UTIL SRC . TESTS EXAMPLES PARPACK
EXTRA_DIST = README PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \
detect_arpack_bug.m4
detect_arpack_bug.m4 CMakeLists.txt
# Pkgconfig directory
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = arpack@LIBSUFFIX@.pc
# Files to install in Pkgconfig directory
pkgconfig_DATA = arpack.pc
DISTCLEANFILES = $(pkgconfig_DATA)
+21 -26
View File
@@ -1,43 +1,38 @@
#LDADD = $(top_builddir)/PARPACK/SRC/BLACS/libparpacksrc.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/PARPACK/SRC/BLACS/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
#SNDRV = psndrv1 psndrv3
#DNDRV = pdndrv1 pdndrv3
#SSDRV = pssdrv1
#DSDRV = pdsdrv1
#CNDRV = pcndrv1
#ZNDRV = pzndrv1
#NTEST = psntest1 pdntest1
SNDRV = psndrv1 psndrv3
DNDRV = pdndrv1 pdndrv3
SSDRV = pssdrv1
DSDRV = pdsdrv1
CNDRV = pcndrv1
ZNDRV = pzndrv1
NTEST = psntest1 pdntest1
#check_PROGRAMS = $(SNDRV) $(DNDRV) $(SSDRV) $(DSDRV) $(CNDRV) $(ZNDRV) $(NTEST)
#TESTS = $(check_PROGRAMS)
check_PROGRAMS = $(SNDRV) $(DNDRV) $(SSDRV) $(DSDRV) $(CNDRV) $(ZNDRV) $(NTEST)
TESTS = $(check_PROGRAMS)
EXTRA_DIST = debug.h stat.h \
psndrv1.f psndrv3.f \
pdndrv1.f pdndrv3.f \
pssdrv1.f pdsdrv1.f \
pcndrv1.f pzndrv1.f \
psntest1.f pdntest1.f
EXTRA_DIST = debug.h stat.h
# Simple nonsymmetric problem using single precision
#psndrv1_SOURCES = psndrv1.f
#psndrv3_SOURCES = psndrv3.f
psndrv1_SOURCES = psndrv1.f
psndrv3_SOURCES = psndrv3.f
# Simple nonsymmetric problem using double precision
#pdndrv1_SOURCES = pdndrv1.f
#pdndrv3_SOURCES = pdndrv3.f
pdndrv1_SOURCES = pdndrv1.f
pdndrv3_SOURCES = pdndrv3.f
# Simple symmetric problem using single precision
#pssdrv1_SOURCES = pssdrv1.f
pssdrv1_SOURCES = pssdrv1.f
# Simple symmetric problem using double precision
#pdsdrv1_SOURCES = pdsdrv1.f
pdsdrv1_SOURCES = pdsdrv1.f
# Complex problem using single complex
#pcndrv1_SOURCES = pcndrv1.f
pcndrv1_SOURCES = pcndrv1.f
# Complex problem using double complex
#pzndrv1_SOURCES = pzndrv1.f
pzndrv1_SOURCES = pzndrv1.f
# Test routines for timing
#psntest1_SOURCES = psntest1.f
#pdntest1_SOURCES = pdntest1.f
psntest1_SOURCES = psntest1.f
pdntest1_SOURCES = pdntest1.f
+1 -1
View File
@@ -1,5 +1,5 @@
F77 = $(MPIF77)
LDADD = $(top_builddir)/PARPACK/libparpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SNDRV = psndrv1 psndrv3
DNDRV = pdndrv1 pdndrv3
+6 -17
View File
@@ -1,18 +1,7 @@
SUBDIRS = UTIL SRC . EXAMPLES/MPI EXAMPLES/BLACS
if MPI
SUBDIRS = UTIL/MPI SRC/MPI . TESTS/MPI EXAMPLES/MPI
endif
lib_LTLIBRARIES = libparpack.la
libparpack_la_SOURCES =
# Force libparpack to be linked with the MPI Fortran compiler.
# The file dummy.f does not need to exist in the source tree.
F77 = $(MPIF77)
nodist_EXTRA_libparpack_la_SOURCES = dummy.f
libparpack_la_LDFLAGS = -no-undefined -version-info 2:0
libparpack_la_LIBADD = \
$(top_builddir)/PARPACK/SRC/MPI/libparpacksrcmpi.la \
$(top_builddir)/PARPACK/UTIL/MPI/libparpackutilmpi.la \
$(top_builddir)/libarpack.la \
$(LAPACK_LIBS) $(BLAS_LIBS) $(MPILIBS)
if BLACS
SUBDIRS = UTIL/BLACS SRC/BLACS . EXAMPLES/BLACS
endif
+7 -2
View File
@@ -14,5 +14,10 @@ ZSRC = pznaitr.f pznapps.f pznaup2.f pznaupd.f pzneigh.f pzneupd.f pzngets.f \
EXTRA_DIST = debug.h stat.h
noinst_LTLIBRARIES = libparpacksrc.la
libparpacksrc_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
lib_LTLIBRARIES = libparpack@LIBSUFFIX@.la
libparpack@LIBSUFFIX@_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@_la_LIBADD = \
$(top_builddir)/PARPACK/UTIL/BLACS/libparpackutil.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@.la \
$(LAPACK_LIBS) $(BLAS_LIBS)
libparpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 2:0
+1 -1
View File
@@ -275,7 +275,7 @@ c
call pivout (comm, logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call pivout (comm, logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call pdvout (comm, logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
+1 -1
View File
@@ -275,7 +275,7 @@ c
call pivout (comm, logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call pivout (comm, logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call psvout (comm, logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
+13 -8
View File
@@ -2,6 +2,7 @@ F77 = $(MPIF77)
FFLAGS_SAV = @FFLAGS@
FFLAGS =
PSRC = pcontext.f
SSRC = psnaitr.f psnapps.f psnaup2.f psnaupd.f psneigh.f psneupd.f psngets.f \
pssaitr.f pssapps.f pssaup2.f pssaupd.f psseigt.f psseupd.f pssgets.f \
psgetv0.f pslarnv.f psnorm2.f
@@ -16,13 +17,17 @@ CSRC = pcnaitr.f pcnapps.f pcnaup2.f pcnaupd.f pcneigh.f pcneupd.f pcngets.f \
ZSRC = pznaitr.f pznapps.f pznaup2.f pznaupd.f pzneigh.f pzneupd.f pzngets.f \
pzgetv0.f pzlarnv.f pdznorm2.f
EXTRA_DIST = debug.h stat.h
EXTRA_DIST = debug.h stat.h pcontext.h
noinst_LTLIBRARIES = libparpack_noopt.la libparpacksrcmpi.la
noinst_LTLIBRARIES = libparpack@LIBSUFFIX@_noopt.la
libparpack@LIBSUFFIX@_noopt_la_SOURCES = pslamch.f pdlamch10.f
libparpack@LIBSUFFIX@_noopt_la_FFLAGS = -O0
libparpack_noopt_la_SOURCES = pslamch.f pdlamch10.f
libparpack_noopt_la_FFLAGS = -O0
libparpacksrcmpi_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpacksrcmpi_la_FFLAGS = $(FFLAGS_SAV)
libparpacksrcmpi_la_LIBADD = libparpack_noopt.la
lib_LTLIBRARIES = libparpack@LIBSUFFIX@.la
libparpack@LIBSUFFIX@_la_SOURCES = $(PSRC) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libparpack@LIBSUFFIX@_la_FFLAGS = $(FFLAGS_SAV)
libparpack@LIBSUFFIX@_la_LIBADD = libparpack@LIBSUFFIX@_noopt.la \
$(top_builddir)/PARPACK/UTIL/MPI/libparpackutil.la \
$(top_builddir)/SRC/libarpack@LIBSUFFIX@.la \
$(LAPACK_LIBS) $(BLAS_LIBS) $(MPILIBS)
libparpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 2:0
+5 -5
View File
@@ -223,6 +223,7 @@ c
& (comm, ido, bmat, n, k, np, nb, resid, rnorm, v, ldv, h, ldh,
& ipntr, workd, workl, info)
c
include 'pcontext.h'
include 'mpif.h'
c
c %---------------%
@@ -278,7 +279,7 @@ c %---------------%
c | Local Scalars |
c %---------------%
c
logical first, orth1, orth2, rstart, step3, step4
logical orth1, orth2, rstart, step3, step4
integer ierr, i, infol, ipj, irj, ivj, iter, itry, j, msglvl,
& jj
Real
@@ -287,7 +288,7 @@ c
Complex
& cnorm
c
save first, orth1, orth2, rstart, step3, step4,
save orth1, orth2, rstart, step3, step4,
& ierr, ipj, irj, ivj, iter, itry, j, msglvl, ovfl,
& betaj, rnorm1, smlnum, ulp, unfl, wnorm
c
@@ -321,13 +322,12 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (aitr_first) then
c
c %-----------------------------------------%
c | Set machine-dependent constants for the |
@@ -342,7 +342,7 @@ c
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
+4 -5
View File
@@ -149,6 +149,7 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -188,12 +189,11 @@ c | Local Scalars & Arrays |
c %------------------------%
c
integer i, iend, istart, j, jj, kplusp, msglvl
logical first
Complex
& cdum, f, g, h11, h21, r, s, sigma, t
Real
& c, ovfl, smlnum, ulp, unfl, tst1
save first, ovfl, smlnum, ulp, unfl
save ovfl, smlnum, ulp, unfl
c
c %----------------------%
c | External Subroutines |
@@ -228,13 +228,12 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
c
c %-----------------------------------------------%
c | Set machine-dependent constants for the |
@@ -248,7 +247,7 @@ c
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
+9 -1
View File
@@ -389,6 +389,7 @@ c
& ( comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,
& iparam, ipntr, workd, workl, lworkl, rwork, info )
c
include 'pcontext.h'
include 'mpif.h'
c
c %------------------%
@@ -446,7 +447,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pcnaup2, pcvout, pivout, arscnd, cstatn
external pcnaup2, pcvout, pivout, arscnd, cstatn, pcontext
c
c %--------------------%
c | External Functions |
@@ -461,6 +462,13 @@ c | Executable Statements |
c %-----------------------%
c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
+10
View File
@@ -0,0 +1,10 @@
c
c Flags for parallel execution
c to be cleared on each new execution of parpack
c
c
subroutine pcontext
include 'pcontext.h'
apps_first = .true.
aitr_first = .true.
end subroutine
+8
View File
@@ -0,0 +1,8 @@
c
c Flags for parallel execution
c to be cleared on each new execution of parpack
c
c
logical apps_first, aitr_first
common/pcntxt/ apps_first, aitr_first
+3 -3
View File
@@ -6,7 +6,7 @@
* and University of California, Berkeley.
* February 28, 1995
*
* The name has been changed in order to avoid symbol collision with
* The name has been changed in order to avoid symbol collision with
* the newer version of PDLAMCH in Scalapack which can not be used
* with MPI context.
*
@@ -86,8 +86,8 @@
TEMP = TEMP1
END IF
*
PDLAMCH = TEMP
PDLAMCH10 = TEMP
*
* End of PDLAMCH
* End of PDLAMCH10
*
END
+2 -2
View File
@@ -220,6 +220,7 @@ c
& ipntr, workd, workl, info)
c
include 'mpif.h'
include 'pcontext.h'
c
c %---------------%
c | MPI Variables |
@@ -310,13 +311,12 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (aitr_first) then
c
c %-----------------------------------------%
c | Set machine-dependent constants for the |
+5 -5
View File
@@ -151,6 +151,7 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -187,11 +188,11 @@ c | Local Scalars & Arrays |
c %------------------------%
c
integer i, iend, ir, istart, j, jj, kplusp, msglvl, nr
logical cconj, first
logical cconj
Double precision
& c, f, g, h11, h12, h21, h22, h32, ovfl, r, s, sigmai,
& sigmar, smlnum, ulp, unfl, u(3), t, tau, tst1
save first, ovfl, smlnum, ulp, unfl
save ovfl, smlnum, ulp, unfl
c
c %----------------------%
c | External Subroutines |
@@ -218,13 +219,12 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
c
c %-----------------------------------------------%
c | Set machine-dependent constants for the |
@@ -238,7 +238,7 @@ c
call dlabad( unfl, ovfl )
ulp = pdlamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
+9 -1
View File
@@ -414,6 +414,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -468,7 +469,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pdnaup2 , pdvout , pivout, arscnd, dstatn
external pdnaup2 , pdvout , pivout, arscnd, dstatn, pcontext
c
c %--------------------%
c | External Functions |
@@ -483,6 +484,13 @@ c | Executable Statements |
c %-----------------------%
c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
+4 -4
View File
@@ -215,6 +215,7 @@ c
& ipntr, workd, workl, info)
c
include 'mpif.h'
include 'pcontext.h'
c
c %---------------%
c | MPI Variables |
@@ -259,7 +260,7 @@ c %---------------%
c | Local Scalars |
c %---------------%
c
logical first, orth1, orth2, rstart, step3, step4
logical orth1, orth2, rstart, step3, step4
integer i, ierr, ipj, irj, ivj, iter, itry, j, msglvl, infol,
& jj
Double precision
@@ -297,7 +298,6 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c
c %---------------------%
@@ -310,8 +310,8 @@ c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
first = .false.
if (aitr_first) then
aitr_first = .false.
c
c %--------------------------------%
c | safmin = safe minimum is such |
+5 -5
View File
@@ -140,6 +140,8 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'mpif.h'
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -176,7 +178,6 @@ c | Local Scalars |
c %---------------%
c
integer i, iend, istart, itop, j, jj, kplusp, msglvl
logical first
Double precision
& a1, a2, a3, a4, big, c, epsmch, f, g, r, s
save epsmch, first
@@ -207,15 +208,14 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
epsmch = pdlamch10(comm, 'Epsilon-Machine')
first = .false.
apps_first = .false.
end if
itop = 1
c
@@ -275,7 +275,7 @@ c
call pivout (comm, logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call pivout (comm, logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call pdvout (comm, logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
+9 -1
View File
@@ -418,6 +418,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -472,7 +473,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pdsaup2 , pdvout , pivout, arscnd, dstats
external pdsaup2 , pdvout , pivout, arscnd, dstats, pcontext
c
c %--------------------%
c | External Functions |
@@ -489,6 +490,13 @@ c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
c | & message level for debugging |
c %-------------------------------%
+5 -5
View File
@@ -220,6 +220,7 @@ c
& ipntr, workd, workl, info)
c
include 'mpif.h'
include 'pcontext.h'
c
c %---------------%
c | MPI Variables |
@@ -264,13 +265,13 @@ c %---------------%
c | Local Scalars |
c %---------------%
c
logical first, orth1, orth2, rstart, step3, step4
logical orth1, orth2, rstart, step3, step4
integer ierr, i, infol, ipj, irj, ivj, iter, itry, j, msglvl,
& jj
Real
& betaj, ovfl, temp1, rnorm1, smlnum, tst1, ulp, unfl,
& wnorm
save first, orth1, orth2, rstart, step3, step4,
save orth1, orth2, rstart, step3, step4,
& ierr, ipj, irj, ivj, iter, itry, j, msglvl, ovfl,
& betaj, rnorm1, smlnum, ulp, unfl, wnorm
c
@@ -310,13 +311,12 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (aitr_first) then
c
c %-----------------------------------------%
c | Set machine-dependent constants for the |
@@ -331,7 +331,7 @@ c
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
+5 -5
View File
@@ -151,6 +151,7 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -187,11 +188,11 @@ c | Local Scalars & Arrays |
c %------------------------%
c
integer i, iend, ir, istart, j, jj, kplusp, msglvl, nr
logical cconj, first
logical cconj
Real
& c, f, g, h11, h12, h21, h22, h32, ovfl, r, s, sigmai,
& sigmar, smlnum, ulp, unfl, u(3), t, tau, tst1
save first, ovfl, smlnum, ulp, unfl
save ovfl, smlnum, ulp, unfl
c
c %----------------------%
c | External Subroutines |
@@ -218,13 +219,12 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
c
c %-----------------------------------------------%
c | Set machine-dependent constants for the |
@@ -238,7 +238,7 @@ c
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
+9 -1
View File
@@ -414,6 +414,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -468,7 +469,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external psnaup2, psvout, pivout, arscnd, sstatn
external psnaup2, psvout, pivout, arscnd, sstatn, pcontext
c
c %--------------------%
c | External Functions |
@@ -483,6 +484,13 @@ c | Executable Statements |
c %-----------------------%
c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
+4 -4
View File
@@ -214,6 +214,7 @@ c
& (comm, ido, bmat, n, k, np, mode, resid, rnorm, v, ldv, h, ldh,
& ipntr, workd, workl, info)
c
include 'pcontext.h'
include 'mpif.h'
c
c %---------------%
@@ -259,7 +260,7 @@ c %---------------%
c | Local Scalars |
c %---------------%
c
logical first, orth1, orth2, rstart, step3, step4
logical orth1, orth2, rstart, step3, step4
integer i, ierr, ipj, irj, ivj, iter, itry, j, msglvl, infol,
& jj
Real
@@ -297,7 +298,6 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c
c %---------------------%
@@ -310,8 +310,8 @@ c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
first = .false.
if (aitr_first) then
aitr_first = .false.
c
c %--------------------------------%
c | safmin = safe minimum is such |
+5 -6
View File
@@ -140,6 +140,7 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -176,10 +177,9 @@ c | Local Scalars |
c %---------------%
c
integer i, iend, istart, itop, j, jj, kplusp, msglvl
logical first
Real
& a1, a2, a3, a4, big, c, epsmch, f, g, r, s
save epsmch, first
save epsmch
c
c
c %----------------------%
@@ -207,15 +207,14 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
epsmch = pslamch(comm, 'Epsilon-Machine')
first = .false.
apps_first = .false.
end if
itop = 1
c
@@ -275,7 +274,7 @@ c
call pivout (comm, logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call pivout (comm, logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call psvout (comm, logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
+9 -1
View File
@@ -418,6 +418,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -472,7 +473,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pssaup2, psvout, pivout, arscnd, sstats
external pssaup2, psvout, pivout, arscnd, sstats, pcontext
c
c %--------------------%
c | External Functions |
@@ -489,6 +490,13 @@ c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
c | & message level for debugging |
c %-------------------------------%
+5 -5
View File
@@ -223,6 +223,7 @@ c
& (comm, ido, bmat, n, k, np, nb, resid, rnorm, v, ldv, h, ldh,
& ipntr, workd, workl, info)
c
include 'pcontext.h'
include 'mpif.h'
c
c %---------------%
@@ -278,7 +279,7 @@ c %---------------%
c | Local Scalars |
c %---------------%
c
logical first, orth1, orth2, rstart, step3, step4
logical orth1, orth2, rstart, step3, step4
integer ierr, i, infol, ipj, irj, ivj, iter, itry, j, msglvl,
& jj
Double precision
@@ -287,7 +288,7 @@ c
Complex*16
& cnorm
c
save first, orth1, orth2, rstart, step3, step4,
save orth1, orth2, rstart, step3, step4,
& ierr, ipj, irj, ivj, iter, itry, j, msglvl, ovfl,
& betaj, rnorm1, smlnum, ulp, unfl, wnorm
c
@@ -321,13 +322,12 @@ c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (aitr_first) then
c
c %-----------------------------------------%
c | Set machine-dependent constants for the |
@@ -342,7 +342,7 @@ c
call dlabad( unfl, ovfl )
ulp = pdlamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
+4 -5
View File
@@ -149,6 +149,7 @@ c %--------------------%
c | MPI Communicator |
c %--------------------%
c
include 'pcontext.h'
integer comm
c
c %----------------------------------------------------%
@@ -188,12 +189,11 @@ c | Local Scalars & Arrays |
c %------------------------%
c
integer i, iend, istart, j, jj, kplusp, msglvl
logical first
Complex*16
& cdum, f, g, h11, h21, r, s, sigma, t
Double precision
& c, ovfl, smlnum, ulp, unfl, tst1
save first, ovfl, smlnum, ulp, unfl
save ovfl, smlnum, ulp, unfl
c
c %----------------------%
c | External Subroutines |
@@ -228,13 +228,12 @@ c %----------------%
c | Data statments |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
if (apps_first) then
c
c %-----------------------------------------------%
c | Set machine-dependent constants for the |
@@ -248,7 +247,7 @@ c
call dlabad( unfl, ovfl )
ulp = pdlamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
+9 -1
View File
@@ -389,6 +389,7 @@ c
& ( comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,
& iparam, ipntr, workd, workl, lworkl, rwork, info )
c
include 'pcontext.h'
include 'mpif.h'
c
c %------------------%
@@ -446,7 +447,7 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pznaup2 , pzvout , pivout, arscnd, zstatn
external pznaup2 , pzvout , pivout, arscnd, zstatn, pcontext
c
c %--------------------%
c | External Functions |
@@ -461,6 +462,13 @@ c | Executable Statements |
c %-----------------------%
c
if (ido .eq. 0) then
c
c %-------------------------------%
c | Initialize parallel execution |
c | context |
c %-------------------------------%
c
call pcontext
c
c %-------------------------------%
c | Initialize timing statistics |
-1
View File
@@ -1 +0,0 @@
SUBDIRS = MPI BLACS
+10
View File
@@ -0,0 +1,10 @@
F77 = $(MPIF77)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
SISS = issue46
check_PROGRAMS = $(SISS)
EXTRA_DIST = debug.h stat.h
issue46_SOURCES= issue46.f
+16
View File
@@ -0,0 +1,16 @@
c
c\SCCS Information: @(#)
c FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2
c
c %---------------------------------%
c | See debug.doc for documentation |
c %---------------------------------%
integer logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
common /debug/
& logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
+468
View File
@@ -0,0 +1,468 @@
c
c----------- Example to reproduce issue#46 ----------------------------------------------
c
program issue46
include 'mpif.h'
integer ierr, comm, color, key, myid, nprocs, cnprocs
call MPI_INIT( ierr )
call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr )
call MPI_COMM_SIZE( MPI_COMM_WORLD, nprocs, ierr )
c Create commuticator to run arnoldi only on the first CPU
if(myid .lt. nprocs/2) then
color = 1
else
color = 0
endif
write(*,*) "Hello", color
call MPI_Comm_split(MPI_COMM_WORLD, color, myid, comm, ierr)
call MPI_COMM_SIZE( comm, cnprocs, ierr )
if(color .eq. 1) call parnoldi(comm)
call MPI_Barrier(MPI_COMM_WORLD, ierr)
call parnoldi(MPI_COMM_WORLD)
call MPI_FINALIZE(ierr)
end
subroutine parnoldi(comm)
include 'mpif.h'
include 'debug.h'
include 'stat.h'
integer comm, myid, nprocs, rc, nloc
c
c %-----------------------------%
c | Define leading dimensions |
c | for all arrays. |
c | MAXN: Maximum dimension |
c | of the A allowed. |
c | MAXNEV: Maximum NEV allowed |
c | MAXNCV: Maximum NCV allowed |
c %-----------------------------%
c
integer maxnloc, maxnev, maxncv, ldv
parameter (maxnloc=256, maxnev=10, maxncv=25,
& ldv=maxnloc )
c
c %--------------%
c | Local Arrays |
c %--------------%
c
Double precision
& v(ldv,maxncv), workl(maxncv*(maxncv+8)),
& workd(3*maxnloc), d(maxncv,2), resid(maxnloc),
& ax(maxnloc)
logical select(maxncv)
integer iparam(11), ipntr(11)
c
c %---------------%
c | Local Scalars |
c %---------------%
c
character bmat*1, which*2
integer ido, n, nev, ncv, lworkl, info, ierr, j,
& nx, nconv, maxitr, mode, ishfts
logical rvec
Double precision
& tol, sigma
c
c %----------------------------------------------%
c | Local Buffers needed for MPI communication |
c %----------------------------------------------%
c
Double precision
& mv_buf(maxnloc)
c
c %------------%
c | Parameters |
c %------------%
c
Double precision
& zero
parameter (zero = 0.0)
c
c %-----------------------------%
c | BLAS & LAPACK routines used |
c %-----------------------------%
c
Double precision
& pdnorm2
external pdnorm2, daxpy
c
c %---------------------%
c | Intrinsic Functions |
c %---------------------%
c
intrinsic abs
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
call MPI_COMM_RANK( comm, myid, ierr )
call MPI_COMM_SIZE( comm, nprocs, ierr )
c
ndigit = -3
logfil = 6
msaupd = 1
c
c %----------------------------------------------------%
c | The number NX is the number of interior points |
c | in the discretization of the 2-dimensional |
c | Laplacian on the unit square with zero Dirichlet |
c | boundary condition. The number N(=NX*NX) is the |
c | dimension of the matrix. A standard eigenvalue |
c | problem is solved (BMAT = 'I'). NEV is the number |
c | of eigenvalues to be approximated. The user can |
c | modify NEV, NCV, WHICH to solve problems of |
c | different sizes, and to get different parts of the |
c | spectrum. However, The following conditions must |
c | be satisfied: |
c | N <= MAXN, |
c | NEV <= MAXNEV, |
c | NEV + 2 <= NCV <= MAXNCV |
c %----------------------------------------------------%
c
nx = 10
n = nx*nx
nev = 4
ncv = 20
c
c %--------------------------------------%
c | Set up distribution of data to nodes |
c %--------------------------------------%
c
nloc = (nx / nprocs)*nx
if ( mod(nx, nprocs) .gt. myid ) nloc = nloc + nx
c
if ( nloc .gt. maxnloc ) then
print *, ' ERROR with _SDRV1: NLOC is greater than MAXNLOC '
go to 9000
else if ( nev .gt. maxnev ) then
print *, ' ERROR with _SDRV1: NEV is greater than MAXNEV '
go to 9000
else if ( ncv .gt. maxncv ) then
print *, ' ERROR with _SDRV1: NCV is greater than MAXNCV '
go to 9000
end if
bmat = 'I'
which = 'SM'
c
c %--------------------------------------------------%
c | The work array WORKL is used in PSSAUPD as |
c | workspace. Its dimension LWORKL is set as |
c | illustrated below. The parameter TOL determines |
c | the stopping criterion. If TOL<=0, machine |
c | precision is used. The variable IDO is used for |
c | reverse communication and is initially set to 0. |
c | Setting INFO=0 indicates that a random vector is |
c | generated in PSSAUPD to start the Arnoldi |
c | iteration. |
c %--------------------------------------------------%
c
lworkl = ncv*(ncv+8)
tol = zero
info = 0
ido = 0
c
c %---------------------------------------------------%
c | This program uses exact shifts with respect to |
c | the current Hessenberg matrix (IPARAM(1) = 1). |
c | IPARAM(3) specifies the maximum number of Arnoldi |
c | iterations allowed. Mode 1 of PSSAUPD is used |
c | (IPARAM(7) = 1). All these options may be |
c | changed by the user. For details, see the |
c | documentation in PSSAUPD. |
c %---------------------------------------------------%
c
ishfts = 1
maxitr = 300
mode = 1
c
iparam(1) = ishfts
iparam(3) = maxitr
iparam(7) = mode
c
c %-------------------------------------------%
c | M A I N L O O P (Reverse communication) |
c %-------------------------------------------%
c
10 continue
c
c %---------------------------------------------%
c | Repeatedly call the routine PSSAUPD and take|
c | actions indicated by parameter IDO until |
c | either convergence is indicated or maxitr |
c | has been exceeded. |
c %---------------------------------------------%
c
call pdsaupd ( comm, ido, bmat, nloc, which, nev, tol, resid,
& ncv, v, ldv, iparam, ipntr, workd, workl,
& lworkl, info )
c
if (ido .eq. -1 .or. ido .eq. 1) then
c
c %--------------------------------------%
c | Perform matrix vector multiplication |
c | y <--- OP*x |
c | The user should supply his/her own |
c | matrix vector multiplication routine |
c | here that takes workd(ipntr(1)) as |
c | the input, and return the result to |
c | workd(ipntr(2)). |
c %--------------------------------------%
c
call av ( comm, nloc, nx, mv_buf,
& workd(ipntr(1)), workd(ipntr(2)))
c
c %-----------------------------------------%
c | L O O P B A C K to call PSSAUPD again.|
c %-----------------------------------------%
c
go to 10
c
end if
c
c %----------------------------------------%
c | Either we have convergence or there is |
c | an error. |
c %----------------------------------------%
c
if ( info .lt. 0 ) then
c
c %--------------------------%
c | Error message. Check the |
c | documentation in PSSAUPD.|
c %--------------------------%
c
if ( myid .eq. 0 ) then
print *, ' '
print *, ' Error with _saupd, info = ', info
print *, ' Check documentation in _saupd '
print *, ' '
endif
c
else
c
c %-------------------------------------------%
c | No fatal errors occurred. |
c | Post-Process using PSSEUPD. |
c | |
c | Computed eigenvalues may be extracted. |
c | |
c | Eigenvectors may also be computed now if |
c | desired. (indicated by rvec = .true.) |
c %-------------------------------------------%
c
rvec = .true.
c
call pdseupd ( comm, rvec, 'All', select,
& d, v, ldv, sigma,
& bmat, nloc, which, nev, tol, resid, ncv, v, ldv,
& iparam, ipntr, workd, workl, lworkl, ierr )
c %----------------------------------------------%
c | Eigenvalues are returned in the first column |
c | of the two dimensional array D and the |
c | corresponding eigenvectors are returned in |
c | the first NEV columns of the two dimensional |
c | array V if requested. Otherwise, an |
c | orthogonal basis for the invariant subspace |
c | corresponding to the eigenvalues in D is |
c | returned in V. |
c %----------------------------------------------%
c
if ( ierr .ne. 0) then
c
c %------------------------------------%
c | Error condition: |
c | Check the documentation of PSSEUPD.|
c %------------------------------------%
c
c
if ( myid .eq. 0 ) then
print *, ' '
print *, ' Error with _seupd, info = ', ierr
print *, ' Check the documentation of _seupd. '
print *, ' '
endif
c
else
c
nconv = iparam(5)
do 20 j=1, nconv
c
c %---------------------------%
c | Compute the residual norm |
c | |
c | || A*x - lambda*x || |
c | |
c | for the NCONV accurately |
c | computed eigenvalues and |
c | eigenvectors. (iparam(5) |
c | indicates how many are |
c | accurate to the requested |
c | tolerance) |
c %---------------------------%
c
call av(comm, nloc, nx, mv_buf, v(1,j), ax)
call daxpy(nloc, -d(j,1), v(1,j), 1, ax, 1)
d(j,2) = pdnorm2( comm, nloc, ax, 1 )
c
20 continue
c
c %-------------------------------%
c | Display computed residuals |
c %-------------------------------%
c
call pdmout(comm, 6, nconv, 2, d, maxncv, -6,
& 'Ritz values and direct residuals')
end if
c
c %------------------------------------------%
c | Print additional convergence information |
c %------------------------------------------%
c
if (myid .eq. 0)then
if ( info .eq. 1) then
print *, ' '
print *, ' Maximum number of iterations reached.'
print *, ' '
else if ( info .eq. 3) then
print *, ' '
print *, ' No shifts could be applied during implicit
& Arnoldi update, try increasing NCV.'
print *, ' '
end if
c
print *, ' '
print *, '_SDRV1 '
print *, '====== '
print *, ' '
print *, ' Size of the matrix is ', n
print *, ' The number of processors is ', nprocs
print *, ' The number of Ritz values requested is ', nev
print *, ' The number of Arnoldi vectors generated',
& ' (NCV) is ', ncv
print *, ' What portion of the spectrum: ', which
print *, ' The number of converged Ritz values is ',
& nconv
print *, ' The number of Implicit Arnoldi update',
& ' iterations taken is ', iparam(3)
print *, ' The number of OP*x is ', iparam(9)
print *, ' The convergence criterion is ', tol
print *, ' '
endif
c
end if
c
c %---------------------------%
c | Done with program pdsdrv1.|
c %---------------------------%
c
9000 continue
c
c
end
c
c ------------------------------------------------------------------
c parallel matrix vector subroutine
c
c The matrix used is the 2 dimensional discrete Laplacian on unit
c square with zero Dirichlet boundary condition.
c
c Computes w <--- OP*v, where OP is the nx*nx by nx*nx block
c tridiagonal matrix
c
c | T -I |
c |-I T -I |
c OP = | -I T |
c | ... -I|
c | -I T|
c
c The subroutine TV is called to computed y<---T*x.
c-------------------------------------------------------------------
c
subroutine av (comm, nloc, nx, mv_buf, v, w)
c
c .. MPI Declarations ...
include 'mpif.h'
integer comm, nprocs, myid, ierr,
& status(MPI_STATUS_SIZE)
integer nloc, nx, np, j, lo, next, prev
Double precision
& v(nloc), w(nloc), mv_buf(nx), one
parameter (one = 1.0 )
external daxpy
call MPI_COMM_RANK( comm, myid, ierr )
call MPI_COMM_SIZE( comm, nprocs, ierr )
c
np = nloc/nx
call tv(nx,v(1),w(1))
call daxpy(nx, -one, v(nx+1), 1, w(1), 1)
c
if ( np .gt. 2) then
do 10 j = 2, np-1
lo = (j-1)*nx
call tv(nx, v(lo+1), w(lo+1))
call daxpy(nx, -one, v(lo-nx+1), 1, w(lo+1), 1)
call daxpy(nx, -one, v(lo+nx+1), 1, w(lo+1), 1)
10 continue
end if
c
if ( np .gt. 1) then
lo = (np-1)*nx
call tv(nx, v(lo+1), w(lo+1))
call daxpy(nx, -one, v(lo-nx+1), 1, w(lo+1), 1)
end if
c
next = myid + 1
prev = myid - 1
if ( myid .lt. nprocs-1 ) then
call mpi_send( v((np-1)*nx+1), nx, MPI_DOUBLE_PRECISION,
& next, myid+1, comm, ierr )
endif
if ( myid .gt. 0 ) then
call mpi_recv( mv_buf, nx, MPI_DOUBLE_PRECISION, prev, myid,
& comm, status, ierr )
call daxpy( nx, -one, mv_buf, 1, w(1), 1 )
endif
c
if ( myid .gt. 0 ) then
call mpi_send( v(1), nx, MPI_DOUBLE_PRECISION,
& prev, myid-1, comm, ierr )
endif
if ( myid .lt. nprocs-1 ) then
call mpi_recv( mv_buf, nx, MPI_DOUBLE_PRECISION, next, myid,
& comm, status, ierr )
call daxpy( nx, -one, mv_buf, 1, w(lo+1), 1 )
endif
c
return
end
c=========================================================================
subroutine tv (nx, x, y)
c
integer nx, j
Double precision
& x(nx), y(nx), dd, dl, du
c
Double precision
& one
parameter (one = 1.0 )
c
c Compute the matrix vector multiplication y<---T*x
c where T is a nx by nx tridiagonal matrix with DD on the
c diagonal, DL on the subdiagonal, and DU on the superdiagonal.
c
c
dd = 4.0
dl = -one
du = -one
c
y(1) = dd*x(1) + du*x(2)
do 10 j = 2,nx-1
y(j) = dl*x(j-1) + dd*x(j) + du*x(j+1)
10 continue
y(nx) = dl*x(nx-1) + dd*x(nx)
return
end
+21
View File
@@ -0,0 +1,21 @@
c %--------------------------------%
c | See stat.doc for documentation |
c %--------------------------------%
c
c\SCCS Information: @(#)
c FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2
c
real t0, t1, t2, t3, t4, t5
save t0, t1, t2, t3, t4, t5
c
integer nopx, nbx, nrorth, nitref, nrstrt
real tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
& tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
& tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
& tmvopx, tmvbx, tgetv0, titref, trvec
common /timing/
& nopx, nbx, nrorth, nitref, nrstrt,
& tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv,
& tnaupd, tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv,
& tcaupd, tcaup2, tcaitr, tceigh, tcgets, tcapps, tcconv,
& tmvopx, tmvbx, tgetv0, titref, trvec
+2 -2
View File
@@ -5,5 +5,5 @@ DSRC = pdmout.f pdvout.f
CSRC = pcmout.f pcvout.f
ZSRC = pzmout.f pzvout.f
noinst_LTLIBRARIES = libparpackutilblacs.la
libparpackutilblacs_la_SOURCES = $(SRCS) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
noinst_LTLIBRARIES = libparpackutil.la
libparpackutil_la_SOURCES = $(SRCS) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
+2 -2
View File
@@ -7,5 +7,5 @@ DSRC = pdmout.f pdvout.f
CSRC = pcmout.f pcvout.f
ZSRC = pzmout.f pzvout.f
noinst_LTLIBRARIES = libparpackutilmpi.la
libparpackutilmpi_la_SOURCES = $(SRCS) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
noinst_LTLIBRARIES = libparpackutil.la
libparpackutil_la_SOURCES = $(SRCS) $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
-1
View File
@@ -1 +0,0 @@
SUBDIRS = MPI BLACS
+4
View File
@@ -331,3 +331,7 @@ c SELECT Logical array of dimension NCV. (INPUT/WORKSPACE)
35. 10/24/2003 p[c,z]naup2.f contain some lines that were incorrectly
generated by cpp. These lines have been removed in the new patch.
36. 09/18/2016 p*apps.f and p*aitr.f contain condition to fetch machine epsilon.
When different p*aupd call use communicator with different number of CPU these
conditions cause deadlock. Variables inside conditions are moved to global
to be reseted each first iteration
+10 -1
View File
@@ -72,9 +72,18 @@ arpack-ng is replacing arpack almost everywhere.
$ sh bootstrap
$ ./configure
$ make
$ make check
$ make install
should work as expected.
Furthermore, ARPACK-NG now provides CMake functionality:
$ mkdir build
$ cd build
$ cmake -D EXAMPLES=ON -D MPI=ON -D BUILD_SHARED_LIBS=ON ..
$ make
$ make install
builds everything including examples and parallel support (with MPI).
5. Within DOCUMENTS directory there are three files
ex-sym.doc
@@ -91,6 +100,6 @@ arpack-ng is replacing arpack almost everywhere.
Chao Yang at cyang@lbl.gov
Kristi Maschhoff at kristyn@tera.com
Sylvestre Ledru at sylvestre@debian.org
Allan Cornet at allan.cornet@scilab.org
Allan Cornet
Good luck and enjoy.
+4 -2
View File
@@ -14,5 +14,7 @@ ZSRC = znaitr.f znapps.f znaup2.f znaupd.f zneigh.f zneupd.f zngets.f zstatn.f \
EXTRA_DIST = debug.h stat.h version.h
noinst_LTLIBRARIES = libarpacksrc.la
libarpacksrc_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
lib_LTLIBRARIES = libarpack@LIBSUFFIX@.la
libarpack@LIBSUFFIX@_la_SOURCES = $(SSRC) $(DSRC) $(CSRC) $(ZSRC)
libarpack@LIBSUFFIX@_la_LIBADD = $(top_builddir)/UTIL/libarpackutil.la $(LAPACK_LIBS) $(BLAS_LIBS)
libarpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 2:0
+3 -1
View File
@@ -599,7 +599,9 @@ c %-------------------------------------------------%
c | Move v(:,kplusp-kev+1:kplusp) into v(:,1:kev). |
c %-------------------------------------------------%
c
call dlacpy ('A', n, kev, v(1,kplusp-kev+1), ldv, v, ldv)
do 150 i = 1, kev
call dcopy(n, v(1,kplusp-kev+i), 1, v(1,i), 1)
150 continue
c
c %--------------------------------------------------------------%
c | Copy the (kev+1)-st column of (V*Q) in the appropriate place |
+12 -9
View File
@@ -1029,19 +1029,22 @@ c %------------------------------------------------%
c
iconj = 0
do 110 j=1, nconv
if (workl(iheigi+j-1) .eq. zero) then
if ((workl(iheigi+j-1) .eq. zero) .and.
& (workl(iheigr+j-1) .ne. zero)) then
workev(j) = workl(invsub+(j-1)*ldq+ncv-1) /
& workl(iheigr+j-1)
else if (iconj .eq. 0) then
temp = dlapy2 ( workl(iheigr+j-1), workl(iheigi+j-1) )
workev(j) = ( workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigr+j-1) +
& workl(invsub+j*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
workev(j+1) = ( workl(invsub+j*ldq+ncv-1) *
& workl(iheigr+j-1) -
& workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
if (temp .ne. zero) then
workev(j) = ( workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigr+j-1) +
& workl(invsub+j*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
workev(j+1) = ( workl(invsub+j*ldq+ncv-1) *
& workl(iheigr+j-1) -
& workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
end if
iconj = 1
else
iconj = 0
+4 -2
View File
@@ -264,7 +264,7 @@ c
call ivout (logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call ivout (logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call dvout (logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
@@ -468,7 +468,9 @@ c %-------------------------------------------------%
c | Move v(:,kplusp-kev+1:kplusp) into v(:,1:kev). |
c %-------------------------------------------------%
c
call dlacpy ('All', n, kev, v(1,np+1), ldv, v, ldv)
do 140 i = 1, kev
call dcopy (n, v(1,np+i), 1, v(1,i), 1)
140 continue
c
c %--------------------------------------------%
c | Copy the (kev+1)-st column of (V*Q) in the |
+1 -1
View File
@@ -306,7 +306,7 @@ c also increases the work and storage required to maintain the orthogonal
c basis vectors. The optimal "cross-over" with respect to CPU time
c is problem dependent and must be determined empirically.
c
c 5. If IPARAM(7) = 2 then in the Reverse commuication interface the user
c 5. If IPARAM(7) = 2 then in the Reverse communication interface the user
c must do the following. When IDO = 1, Y = OP * X is to be computed.
c When IPARAM(7) = 2 OP = inv(B)*A. After computing A*X the user
c must overwrite X with A*X. Y is then the solution to the linear set
+12 -9
View File
@@ -1028,19 +1028,22 @@ c %------------------------------------------------%
c
iconj = 0
do 110 j=1, nconv
if (workl(iheigi+j-1) .eq. zero) then
if ((workl(iheigi+j-1) .eq. zero) .and.
& (workl(iheigr+j-1) .ne. zero)) then
workev(j) = workl(invsub+(j-1)*ldq+ncv-1) /
& workl(iheigr+j-1)
else if (iconj .eq. 0) then
temp = slapy2( workl(iheigr+j-1), workl(iheigi+j-1) )
workev(j) = ( workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigr+j-1) +
& workl(invsub+j*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
workev(j+1) = ( workl(invsub+j*ldq+ncv-1) *
& workl(iheigr+j-1) -
& workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
if (temp. ne. zero) then
workev(j) = ( workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigr+j-1) +
& workl(invsub+j*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
workev(j+1) = ( workl(invsub+j*ldq+ncv-1) *
& workl(iheigr+j-1) -
& workl(invsub+(j-1)*ldq+ncv-1) *
& workl(iheigi+j-1) ) / temp / temp
end if
iconj = 1
else
iconj = 0
+1 -1
View File
@@ -264,7 +264,7 @@ c
call ivout (logfil, 1, i, ndigit,
& '_sapps: deflation at row/column no.')
call ivout (logfil, 1, jj, ndigit,
& '_sapps: occured before shift number.')
& '_sapps: occurred before shift number.')
call svout (logfil, 1, h(i+1,1), ndigit,
& '_sapps: the corresponding off diagonal element')
end if
+8 -6
View File
@@ -1,15 +1,17 @@
LDADD=$(top_builddir)/libarpack.la $(BLAS_LIBS) $(LAPACK_LIBS)
LDADD=$(top_builddir)/SRC/libarpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
AM_DEFAULT_SOURCE_EXT = .f
check_PROGRAMS = dnsimp bug_1315_single bug_1315_double bug_1323 bug_58_double
TESTS = $(check_PROGRAMS)
check_PROGRAMS = dnsimp bug_1315_single bug_1315_double bug_1323
TESTS = test-dnsimp.sh bug_1315_single bug_1315_double bug_1323
EXTRA_DIST = testA.mtx test-dnsimp.sh
EXTRA_DIST = testA.mtx
dnsimp_SOURCES = dnsimp.f mmio.f debug.h
bug_1315_single_SOURCES = bug_1315_single.c
bug_1315_double_SOURCES = bug_1315_double.c
bug_1315_single_LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la
bug_1315_double_LDADD = $(top_builddir)/SRC/libarpack$(LIBSUFFIX).la
bug_1323_SOURCES = bug_1323.f
bug_58_double_SOURCES = bug_58_double.f
+33 -22
View File
@@ -2,6 +2,10 @@
#include <stdlib.h>
#include <math.h>
#ifdef INCLUDE_FCMANGLE
#include "FCMangle.h"
#endif
/* test program to solve for the 9 largest eigenvalues of
* A*x = lambda*x where A is the diagonal matrix
* with entries 1000, 999, ... , 2, 1 on the diagonal.
@@ -9,15 +13,18 @@
* This is not efficient since the problem is
* symmetric but is done to exhibit the bug.
* */
#ifndef BLASINT
#define BLASINT int
#endif
extern void dnaupd_(int *, char *, int *, char *, int *,
double *, double *, int *, double *,
int *, int *, int *, double *,
double *, int *, int *);
extern void dnaupd(BLASINT *, char *, BLASINT *, char *, BLASINT *,
double *, double *, BLASINT *, double *,
BLASINT *, BLASINT *, BLASINT *, double *,
double *, BLASINT *, BLASINT *);
extern void dneupd_( int*, char*, int *, double *, double *, double *, int*, double *,
double *, double *, char *, int *, char *, int *, double *, double *, int *,
double *, int *, int *, int *, double *, double *, int *, int * );
extern void dneupd( BLASINT*, char*, BLASINT *, double *, double *, double *, BLASINT*, double *,
double *, double *, char *, BLASINT *, char *, BLASINT *, double *, double *, BLASINT *,
double *, BLASINT *, BLASINT *, BLASINT *, double *, double *, BLASINT *, BLASINT * );
void matVec(double * x, double * y) {
int i;
@@ -26,26 +33,26 @@ void matVec(double * x, double * y) {
};
int main() {
int ido = 0;
BLASINT ido = 0;
char bmat[] = "I";
int N = 1000;
BLASINT N = 1000;
char which[] = "LM";
int nev = 9;
BLASINT nev = 9;
double tol = 0;
double resid[N];
int ncv = 2*nev+1;
BLASINT ncv = 2*nev+1;
double V[ncv*N];
int ldv = N;
int iparam[11];
int ipntr[14];
BLASINT ldv = N;
BLASINT iparam[11];
BLASINT ipntr[14];
double workd[3*N];
int rvec = 1;
BLASINT rvec = 1;
char howmny[] = "A";
double* dr = (double*) malloc((nev+1)*sizeof(double));
double* di = (double*) malloc((nev+1)*sizeof(double));
int select[3*ncv];
BLASINT select[3*ncv];
double z[(N+1)*(nev+1)];
int ldz = N+1;
BLASINT ldz = N+1;
double sigmar=0;
double sigmai=0;
double workev[3*ncv];
@@ -55,34 +62,38 @@ int main() {
double workl[3*(ncv*ncv) + 6*ncv];
for (k=0; k < 3*(ncv*ncv) + 6*ncv; ++k )
workl[k] = 0;
int lworkl = 3*(ncv*ncv) + 6*ncv;
int info = 0;
BLASINT lworkl = 3*(ncv*ncv) + 6*ncv;
BLASINT info = 0;
iparam[0] = 1;
iparam[2] = 10*N;
iparam[3] = 1;
iparam[6] = 1;
dnaupd_(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
dnaupd(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
while(ido == 1) {
matVec(&(workd[ipntr[0]-1]), &(workd[ipntr[1]-1]));
dnaupd_(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
dnaupd(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
}
dneupd_( &rvec, howmny, select, dr,di, z, &ldz, &sigmar, &sigmai,workev,
dneupd( &rvec, howmny, select, dr,di, z, &ldz, &sigmar, &sigmai,workev,
bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
int i;
for (i = 0; i < nev; ++i) {
printf("%f\n", dr[i]);
if(fabs(dr[i] - (double)(1000-i))>1e-6){
free(dr);
free(di);
exit(EXIT_FAILURE);
}
}
free(dr);
free(di);
return 0;
}
+33 -22
View File
@@ -2,6 +2,10 @@
#include <stdlib.h>
#include <math.h>
#ifdef INCLUDE_FCMANGLE
#include "FCMangle.h"
#endif
/* test program to solve for the 9 largest eigenvalues of
* A*x = lambda*x where A is the diagonal matrix
* with entries 1000, 999, ... , 2, 1 on the diagonal.
@@ -9,15 +13,18 @@
* This is not efficient since the problem is
* symmetric but is done to exhibit the bug.
*/
#ifndef BLASINT
#define BLASINT int
#endif
extern void snaupd_(int *, char *, int *, char *, int *,
float *, float *, int *, float *,
int *, int *, int *, float *,
float *, int *, int *);
extern void snaupd(BLASINT *, char *, BLASINT *, char *, BLASINT *,
float *, float *, BLASINT *, float *,
BLASINT *, BLASINT *, BLASINT *, float *,
float *, BLASINT *, BLASINT *);
extern void sneupd_( int*, char*, int *, float *, float *, float *, int*, float *,
float *, float *, char *, int *, char *, int *, float *, float *, int *,
float *, int *, int *, int *, float *, float *, int *, int * );
extern void sneupd( BLASINT*, char*, BLASINT *, float *, float *, float *, BLASINT*, float *,
float *, float *, char *, BLASINT *, char *, BLASINT *, float *, float *, BLASINT *,
float *, BLASINT *, BLASINT *, BLASINT *, float *, float *, BLASINT *, BLASINT * );
void matVec(float * x, float * y) {
@@ -27,26 +34,26 @@ void matVec(float * x, float * y) {
};
int main() {
int ido = 0;
BLASINT ido = 0;
char bmat[] = "I";
int N = 1000;
BLASINT N = 1000;
char which[] = "LM";
int nev = 9;
BLASINT nev = 9;
float tol = 0;
float resid[N];
int ncv = 2*nev+1;
BLASINT ncv = 2*nev+1;
float V[ncv*N];
int ldv = N;
int iparam[11];
int ipntr[14];
BLASINT ldv = N;
BLASINT iparam[11];
BLASINT ipntr[14];
float workd[3*N];
int rvec = 1;
BLASINT rvec = 1;
char howmny[] = "A";
float* dr = (float*) malloc((nev+1)*sizeof(float));
float* di = (float*) malloc((nev+1)*sizeof(float));
int select[3*ncv];
BLASINT select[3*ncv];
float z[(N+1)*(nev+1)];
int ldz = N+1;
BLASINT ldz = N+1;
float sigmar=0;
float sigmai=0;
float workev[3*ncv];
@@ -56,34 +63,38 @@ int main() {
float workl[3*(ncv*ncv) + 6*ncv];
for (k=0; k < 3*(ncv*ncv) + 6*ncv; ++k )
workl[k] = 0;
int lworkl = 3*(ncv*ncv) + 6*ncv;
int info = 0;
BLASINT lworkl = 3*(ncv*ncv) + 6*ncv;
BLASINT info = 0;
iparam[0] = 1;
iparam[2] = 10*N;
iparam[3] = 1;
iparam[6] = 1;
snaupd_(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
snaupd(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
while(ido == 1) {
matVec(&(workd[ipntr[0]-1]), &(workd[ipntr[1]-1]));
snaupd_(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
snaupd(&ido, bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
}
sneupd_( &rvec, howmny, select, dr,di, z, &ldz, &sigmar, &sigmai,workev,
sneupd( &rvec, howmny, select, dr,di, z, &ldz, &sigmar, &sigmai,workev,
bmat, &N, which, &nev, &tol, resid, &ncv, V, &ldv, iparam, ipntr,
workd, workl, &lworkl, &info);
int i;
for (i = 0; i < nev; ++i) {
printf("%f\n", dr[i]);
if(fabs(dr[i] - (float)(1000-i))>1e-2){
free(dr);
free(di);
exit(EXIT_FAILURE);
}
}
free(dr);
free(di);
return 0;
}
+430
View File
@@ -0,0 +1,430 @@
program dndrv2
implicit none
c
c Test program to show that an eigenvector for a modified, singular
c 9x9 identity matrix is a column of NaNs. See issue #58. The problem
c is in the purification stage of dneupd.
c
c The shift sigma is the real number -1.0d0.
c
c OP = inv[A-sigma*I] and B = I.
c
c Use mode 3 of DNAUPD.
c
c\BeginLib
c
c\Routines called:
c dnaupd ARPACK reverse communication interface routine.
c dneupd ARPACK routine that returns Ritz values and (optionally)
c Ritz vectors.
c dgttrf LAPACK tridiagonal factorization routine.
c dgttrs LAPACK tridiagonal solve routine.
c dlapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c daxpy Level 1 BLAS that computes y <- alpha*x+y.
c dcopy Level 1 BLAS that copies one vector to another.
c ddot Level 1 BLAS that computes the dot product of two vectors.
c dnrm2 Level 1 BLAS that computes the norm of a vector.
c av Matrix vector multiplication routine that computes A*x.
c
c\Author
c Richard Lehoucq
c Danny Sorensen
c Chao Yang
c Dept. of Computational &
c Applied Mathematics
c Rice University
c Houston, Texas
c
c\SCCS Information: @(#)
c FILE: ndrv2.F SID: 2.5 DATE OF SID: 10/17/00 RELEASE: 2
c
c\Remarks
c 1. None
c
c\EndLib
c--------------------------------------------------------------------------
c
c %-----------------------------%
c | Define leading dimensions |
c | for all arrays. |
c | MAXN: Maximum dimension |
c | of the A allowed. |
c | MAXNEV: Maximum NEV allowed |
c | MAXNCV: Maximum NCV allowed |
c %-----------------------------%
c
integer maxn, maxnev, maxncv, ldv
parameter (maxn=9, maxnev=9, maxncv=9,
& ldv=maxn )
c
c %--------------%
c | Local Arrays |
c %--------------%
c
integer iparam(11), ipntr(14), ipiv(maxn)
logical select(maxncv)
Double precision
& ax(maxn), d(maxncv,3), resid(maxn),
& v(ldv, maxncv), workd(3*maxn),
& workev(3*maxncv),
& workl(3*maxncv*maxncv+6*maxncv),
& dd(maxn), dl(maxn), du(maxn),
& du2(maxn), a(maxn,maxn), c(maxn,maxn)
c
c %---------------%
c | Local Scalars |
c %---------------%
c
character bmat*1, which*2
integer ido, n, nev, ncv, lworkl, info, j, i, k,
& ierr, nconv, maxitr, ishfts, mode, nnz
Double precision
& tol, h, s,
& sigmar, sigmai, s1, s2, s3
logical first, rvec
c
c %------------%
c | Parameters |
c %------------%
c
Double precision
& one, zero, two, rho
common /convct/ rho
parameter (one = 1.0D+0, zero = 0.0D+0,
& two = 2.0D+0)
c
c %-----------------------------%
c | BLAS & LAPACK routines used |
c %-----------------------------%
c
Double precision
& ddot, dnrm2, dlapy2
external dgttrf, dgttrs, ddot, dnrm2, dlapy2
c
c %--------------------%
c | Intrinsic function |
c %--------------------%
c
intrinsic abs
c
c %-----------------------%
c | Executable statements |
c %-----------------------%
c
c %--------------------------------------------------%
c | The number N is the dimension of the matrix. A |
c | standard eigenvalue problem is solved (BMAT = |
c | 'I'). NEV is the number of eigenvalues (closest |
c | to the shift SIGMAR) to be approximated. Since |
c | the shift-invert mode is used, WHICH is set to |
c | 'LM'. The user can modify NEV, NCV, SIGMAR to |
c | solve problems of different sizes, and to get |
c | different parts of the spectrum. However, The |
c | following conditions must be satisfied: |
c | N <= MAXN, |
c | NEV <= MAXNEV, |
c | NEV + 2 <= NCV <= MAXNCV |
c %--------------------------------------------------%
c
nev = 4
ncv = 8
do i = 1,maxn
do j = 1,maxn
a(i,j) = 0.0d0
c(i,j) = 0.0d0
end do
end do
n = 9
do i = 1,n
a(i,i) = 1.0d0
c(i,i) = 1.0d0
end do
a(1,1) = 0.0d0
c(1,1) = 0.0d0
a(1,n) = 1.0d0
c(1,n) = 1.0d0
if ( n .gt. maxn ) then
print *, ' ERROR with _NDRV2: N is greater than MAXN '
go to 9000
else if ( nev .gt. maxnev ) then
print *, ' ERROR with _NDRV2: NEV is greater than MAXNEV '
go to 9000
else if ( ncv .gt. maxncv ) then
print *, ' ERROR with _NDRV2: NCV is greater than MAXNCV '
go to 9000
end if
bmat = 'I'
which = 'LM'
sigmar = -1.0D+0
sigmai = 0.0D+0
c
c %----------------------------------------------------%
c | Construct C = A - SIGMA*I in real arithmetic, and |
c | factor C in real arithmetic using LAPACK |
c | subroutine dgttrf. The matrix A is chosen to be |
c | the tridiagonal matrix derived from standard |
c | central difference of the 1-d convection diffusion |
c | operator u" + rho*u' on the interval [0, 1] with |
c | zero Dirichlet boundary condition. |
c %----------------------------------------------------%
c
do i = 1,n
c(i,i) = c(i,i) - sigmar
end do
c
call dgetrf(n, n, c, maxn, ipiv, ierr)
if ( ierr .ne. 0 ) then
print*, ' '
print*, ' ERROR with _gttrf in _NDRV2.'
print*, ' '
go to 9000
end if
c
c %-----------------------------------------------------%
c | The work array WORKL is used in DNAUPD as |
c | workspace. Its dimension LWORKL is set as |
c | illustrated below. The parameter TOL determines |
c | the stopping criterion. If TOL<=0, machine |
c | precision is used. The variable IDO is used for |
c | reverse communication, and is initially set to 0. |
c | Setting INFO=0 indicates that a random vector is |
c | generated in DNAUPD to start the Arnoldi iteration. |
c %-----------------------------------------------------%
c
lworkl = 3*ncv**2+6*ncv
tol = zero
ido = 0
info = 0
c
c %---------------------------------------------------%
c | This program uses exact shifts with respect to |
c | the current Hessenberg matrix (IPARAM(1) = 1). |
c | IPARAM(3) specifies the maximum number of Arnoldi |
c | iterations allowed. Mode 3 of DNAUPD is used |
c | (IPARAM(7) = 3). All these options can be |
c | changed by the user. For details see the |
c | documentation in DNAUPD. |
c %---------------------------------------------------%
c
ishfts = 1
maxitr = 300
mode = 3
iparam(1) = ishfts
iparam(3) = maxitr
iparam(7) = mode
c
c %-------------------------------------------%
c | M A I N L O O P (Reverse communication) |
c %-------------------------------------------%
c
20 continue
c
c %---------------------------------------------%
c | Repeatedly call the routine DNAUPD and take |
c | actions indicated by parameter IDO until |
c | either convergence is indicated or maxitr |
c | has been exceeded. |
c %---------------------------------------------%
c
call dnaupd ( ido, bmat, n, which, nev, tol, resid,
& ncv, v, ldv, iparam, ipntr, workd, workl, lworkl,
& info )
c
if ( ido .eq. -1 .or. ido .eq. 1) then
c
c %-------------------------------------------%
c | Perform y <--- OP*x = inv[A-SIGMA*I]*x |
c | The user should supply his/her own linear |
c | system solver here that takes |
c | workd(ipntr(1)) as the input, and returns |
c | the result to workd(ipntr(2)). |
c %-------------------------------------------%
c
call dcopy( n, workd(ipntr(1)), 1, workd(ipntr(2)), 1)
c
call dgetrs('N', n, 1, c, maxn, ipiv,
& workd(ipntr(2)), n, ierr)
if ( ierr .ne. 0 ) then
print*, ' '
print*, ' ERROR with _gttrs in _NDRV2.'
print*, ' '
go to 9000
end if
c
c %-----------------------------------------%
c | L O O P B A C K to call DNAUPD again. |
c %-----------------------------------------%
c
go to 20
c
end if
c
c %-----------------------------------------%
c | Either we have convergence, or there is |
c | an error. |
c %-----------------------------------------%
c
if ( info .lt. 0 ) then
c
c %--------------------------%
c | Error message, check the |
c | documentation in DNAUPD. |
c %--------------------------%
c
print *, ' '
print *, ' Error with _naupd, info = ', info
print *, ' Check the documentation in _naupd.'
print *, ' '
c
else
c
c %-------------------------------------------%
c | No fatal errors occurred. |
c | Post-Process using DNEUPD. |
c | |
c | Computed eigenvalues may be extracted. |
c | |
c | Eigenvectors may also be computed now if |
c | desired. (indicated by rvec = .true.) |
c %-------------------------------------------%
c
rvec = .true.
c
call dneupd ( rvec, 'A', select, d, d(1,2), v, ldv,
& sigmar, sigmai, workev, bmat, n, which, nev, tol,
& resid, ncv, v, ldv, iparam, ipntr, workd,
& workl, lworkl, ierr )
c
c %-----------------------------------------------%
c | The real part of the eigenvalue is returned |
c | in the first column of the two dimensional |
c | array D, and the imaginary part is returned |
c | in the second column of D. The corresponding |
c | eigenvectors are returned in the first NEV |
c | columns of the two dimensional array V if |
c | requested. Otherwise, an orthogonal basis |
c | for the invariant subspace corresponding to |
c | the eigenvalues in D is returned in V. |
c %-----------------------------------------------%
c
if ( ierr .ne. 0 ) then
c
c %------------------------------------%
c | Error condition: |
c | Check the documentation of DNEUPD. |
c %------------------------------------%
c
print *, ' '
print *, ' Error with _neupd, info = ', ierr
print *, ' Check the documentation of _neupd. '
print *, ' '
c
else
c
first = .true.
nconv = iparam(5)
do 30 j=1, nconv
c
c %---------------------------%
c | Compute the residual norm |
c | |
c | || A*x - lambda*x || |
c | |
c | for the NCONV accurately |
c | computed eigenvalues and |
c | eigenvectors. (iparam(5) |
c | indicates how many are |
c | accurate to the requested |
c | tolerance) |
c %---------------------------%
c
if (d(j,2) .eq. zero) then
c
c %--------------------%
c | Ritz value is real |
c %--------------------%
c
call dgemv('N',n,n,1.0d0,a,maxn,v(1,j),1,0.0d0,ax,1)
call daxpy(n, -d(j,1), v(1,j), 1, ax, 1)
d(j,3) = dnrm2(n, ax, 1)
d(j,3) = d(j,3) / abs(d(j,1))
c
else if (first) then
c
c %------------------------%
c | Ritz value is complex |
c | Residual of one Ritz |
c | value of the conjugate |
c | pair is computed. |
c %------------------------%
c
call dgemv('N',n,n,1.0d0,a,maxn,v(1,j),1,0.0d0,ax,1)
call daxpy(n, -d(j,1), v(1,j), 1, ax, 1)
call daxpy(n, d(j,2), v(1,j+1), 1, ax, 1)
d(j,3) = dnrm2(n, ax, 1)
call dgemv('N',n,n,1.0d0,a,maxn,v(1,j+1),1,0.0d0,ax,1)
call daxpy(n, -d(j,2), v(1,j), 1, ax, 1)
call daxpy(n, -d(j,1), v(1,j+1), 1, ax, 1)
d(j,3) = dlapy2( d(j,3), dnrm2(n, ax, 1) )
d(j+1,3) = d(j,3)
first = .false.
else
first = .true.
end if
c
30 continue
c
c %-----------------------------%
c | Display computed residuals. |
c %-----------------------------%
c
call dmout(6, nconv, 3, d, maxncv, -6,
& 'Ritz values (Real,Imag) and relative residuals')
c
end if
c
c %-------------------------------------------%
c | Print additional convergence information. |
c %-------------------------------------------%
c
if ( info .eq. 1) then
print *, ' '
print *, ' Maximum number of iterations reached.'
print *, ' '
else if ( info .eq. 3) then
print *, ' '
print *, ' No shifts could be applied during implicit',
& ' Arnoldi update, try increasing NCV.'
print *, ' '
end if
c
print *, ' '
print *, ' _NDRV2 '
print *, ' ====== '
print *, ' '
print *, ' Size of the matrix is ', n
print *, ' The number of Ritz values requested is ', nev
print *, ' The number of Arnoldi vectors generated',
& ' (NCV) is ', ncv
print *, ' What portion of the spectrum: ', which
print *, ' The number of converged Ritz values is ',
& nconv
print *, ' The number of Implicit Arnoldi update',
& ' iterations taken is ', iparam(3)
print *, ' The number of OP*x is ', iparam(9)
print *, ' The convergence criterion is ', tol
print *, ' '
c
end if
if (isnan(v(1,1))) then
stop 1
end if
c
c %---------------------------%
c | Done with program dndrv2. |
c %---------------------------%
c
9000 continue
c
end
-3
View File
@@ -1,3 +0,0 @@
#!/bin/sh
pwd=$(pwd)
cd "$srcdir" && exec "$pwd/dnsimp"
+1 -1
View File
@@ -6,5 +6,5 @@ Name: @PACKAGE_NAME@
Description: Collection of Fortran77 subroutines designed to solve large scale eigenvalue problems
Version: @PACKAGE_VERSION@
URL: @PACKAGE_URL@
Libs: -L${libdir} -larpack
Libs: -L${libdir} -larpack@LIBSUFFIX@
Libs.private: @LAPACK_LIBS@ @BLAS_LIBS@
+93 -33
View File
@@ -1,5 +1,5 @@
AC_PREREQ(2.59)
AC_INIT([ARPACK-NG],[3.3.0],[https://github.com/opencollab/arpack-ng/issues/],[arpack-ng],[https://github.com/opencollab/arpack-ng/])
AC_PREREQ(2.67)
AC_INIT([ARPACK-NG],[3.5.0],[https://github.com/opencollab/arpack-ng/issues/],[arpack-ng],[https://github.com/opencollab/arpack-ng/])
AM_INIT_AUTOMAKE([foreign])
AM_MAINTAINER_MODE
@@ -7,9 +7,81 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_LINKS([TESTS/testA.mtx:TESTS/testA.mtx])
dnl Checks for standard programs.
AC_PROG_F77
AC_PROG_FC
AC_PROG_CC
dnl Check for BLAS libraries
sinclude(ax_blas.m4)
AX_BLAS([], [AC_MSG_ERROR([cannot find BLAS libraries])])
dnl Check for LAPACK libraries
sinclude(ax_lapack.m4)
AX_LAPACK([], [AC_MSG_ERROR([cannot find LAPACK libraries])])
AC_ARG_VAR(INTERFACE64, [set to 1 to use the 64-bit integer interface (ILP64) for ARPACK, BLAS and LAPACK])
if test x"$INTERFACE64" == x"1"; then
AX_CHECK_COMPILE_FLAG(-fdefault-integer-8, FFLAGS="$FFLAGS -fdefault-integer-8",
AX_CHECK_COMPILE_FLAG(-i8, FFLAGS="$FFLAGS -i8",
AC_MSG_WARN([configure does not know how to make your Fortran compiler use 64-bit integers: set it manually via FFLAGS.])))
CFLAGS="$CFLAGS -DBLASINT=int64_t"
fi
AC_ARG_VAR(LIBSUFFIX, [suffix to add to ARPACK libraries names])
AC_ARG_VAR(SYMBOLSUFFIX, [suffix to add to ARPACK, BLAS and LAPACK function names])
if test x"$SYMBOLSUFFIX" != x""; then
dnl Need to rely on non-F77 features
AC_FC_LINE_LENGTH(unlimited)
FFLAGS="$FFLAGS $ac_cv_fc_line_length"
AX_CHECK_COMPILE_FLAG(-cpp, FFLAGS="$FFLAGS -cpp",
AX_CHECK_COMPILE_FLAG(-fpp, FFLAGS="$FFLAGS -fpp",
AC_MSG_WARN([configure does not know how to enable your Fortran compiler's preprocessor: set it manually via FFLAGS.])))
SCALARFUNS="naitr napps naup2 naupd nconv neigh neupd ngets statn saitr sapps saup2 saupd sconv seigt seupd sgets stats getv0 sortc sortr sesrt stqrb"
COMPLEXFUNS="naitr napps naup2 naupd neigh neupd ngets statn getv0 sortc"
BLASFUNS1="axpy copy gemv geqr2 lacpy lae2 lahqr lanhs larnv lartg lascl laset lasrt scal trevc trmm trsen gbmv gbtrf gbtrs gttrf gttrs pttrf pttrs"
BLASFUNS2="dot ger labad laev2 lamch lanst lanv2 lapy2 larf larfg lasr nrm2 orm2r rot steqr swap"
BLASFUNS3="dotc geru unm2r"
BLASFUNS4="COPY LABAD LAMCH LANHS LANV2 LARFG ROT GEMV"
BLASFUNS5="scnrm2 dznrm2 csscal zdscal"
FUNS1="$SCALARFUNS $BLASFUNS1 $BLASFUNS2"
for f in $FUNS1
do
FFLAGS="$FFLAGS -Ds$f=s$f$SYMBOLSUFFIX -Dd$f=d$f$SYMBOLSUFFIX"
done
FUNS2="$COMPLEXFUNS $BLASFUNS1 $BLASFUNS3"
for f in $FUNS2
do
FFLAGS="$FFLAGS -Dc$f=c$f$SYMBOLSUFFIX -Dz$f=z$f$SYMBOLSUFFIX"
done
for f in $BLASFUNS4
do
FFLAGS="$FFLAGS -DS$f=S$f$SYMBOLSUFFIX -DD$f=D$f$SYMBOLSUFFIX"
done
for f in $BLASFUNS5
do
FFLAGS="$FFLAGS -D$f=$f$SYMBOLSUFFIX -D$f=$f$SYMBOLSUFFIX"
done
fi
dnl Both a lowercase and uppercase variable are needed
dnl since the macro changes the case of the whole expression
symbolsuffix=$SYMBOLSUFFIX
AC_F77_FUNC(sgemm$SYMBOLSUFFIX, sgemmsuff)
AC_F77_FUNC(snaupd$SYMBOLSUFFIX, snaupdsuff)
AC_F77_FUNC(sneupd$SYMBOLSUFFIX, sneupdsuff)
AC_F77_FUNC(dnaupd$SYMBOLSUFFIX, dnaupdsuff)
AC_F77_FUNC(dneupd$SYMBOLSUFFIX, dneupdsuff)
AC_F77_FUNC(cheev$SYMBOLSUFFIX, cheevsuff)
dnl Needed for BLAS check and for tests (even when suffix is empty)
CFLAGS="$CFLAGS -Dsgemm=$sgemmsuff -Dsnaupd=$snaupdsuff -Dsneupd=$sneupdsuff -Ddnaupd=$dnaupdsuff -Ddneupd=$dneupdsuff -Dcheev=$cheevsuff"
ifdef([LT_INIT], [], [
errprint([error: you must have libtool 2.4.2 or a more recent version
])
@@ -18,37 +90,26 @@ ifdef([LT_INIT], [], [
LT_PREREQ([2.4.2])
LT_INIT([win32-dll])
dnl Check for BLAS libraries
sinclude(ax_blas.m4)
AX_BLAS
if test "$ax_blas_ok" = "no"; then
AC_MSG_ERROR([Cannot find BLAS libraries])
fi
dnl Check for LAPACK libraries
sinclude(ax_lapack.m4)
AX_LAPACK
if test "$ax_lapack_ok" = "no"; then
AC_MSG_ERROR([Cannot find LAPACK libraries])
fi
dnl See if compiling parpack
AC_MSG_CHECKING([for MPI mode])
AC_ARG_ENABLE(mpi,
AC_HELP_STRING([--enable-mpi],
[build parallel version of arpack with MPI]),
[enable_mpi=$enableval],
[enable_mpi=no])
if test x"$enable_mpi" != x"no"; then
AC_LANG_PUSH([Fortran 77])
AX_MPI([], AC_MSG_ERROR([could not compile a MPI test program]))
AC_LANG_POP([Fortran 77])
fi
AC_ARG_ENABLE([mpi],
[AS_HELP_STRING(
[--enable-mpi],
[build parallel version of arpack with MPI])],
[],
[AS_VAR_SET([enable_mpi], [no])])
AS_IF([test x"$enable_mpi" != x"no"], [
AC_LANG_PUSH([Fortran 77])
AX_MPI([], AC_MSG_ERROR([could not compile a MPI test program]))
AC_LANG_POP([Fortran 77])
])
AM_CONDITIONAL(MPI, test x"$enable_mpi" = x"yes")
AM_CONDITIONAL([MPI], [test x"$enable_mpi" != x"no"])
AM_CONDITIONAL([BLACS], [false])
m4_ifdef([PKG_INSTALLDIR], [PKG_INSTALLDIR], [AC_SUBST([pkgconfigdir], [${libdir}/pkgconfig])])
AC_CONFIG_FILES([arpack$LIBSUFFIX.pc:arpack.pc.in], [], [LIBSUFFIX="$LIBSUFFIX"])
AC_CONFIG_FILES([
arpack.pc
Makefile
SRC/Makefile
UTIL/Makefile
@@ -61,13 +122,12 @@ AC_CONFIG_FILES([
EXAMPLES/SVD/Makefile
EXAMPLES/SYM/Makefile
PARPACK/Makefile
PARPACK/SRC/Makefile
PARPACK/SRC/MPI/Makefile
PARPACK/SRC/BLACS/Makefile
PARPACK/UTIL/Makefile
PARPACK/UTIL/MPI/Makefile
PARPACK/UTIL/BLACS/Makefile
PARPACK/TESTS/MPI/Makefile
PARPACK/EXAMPLES/MPI/Makefile
PARPACK/EXAMPLES/BLACS/Makefile
])
])
AC_OUTPUT
+72
View File
@@ -0,0 +1,72 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 2
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS