159 Commits
Author SHA1 Message Date
Darcy Beurle 390a4457cf Update contribution 2018-06-04 16:52:54 +02:00
Darcy Beurle 9c9affa982 External "C" for .h file incase we have pre c++11 2018-06-04 16:52:54 +02:00
Darcy Beurle 2333f73976 Parpack bindings modernised 2018-06-04 16:52:54 +02:00
ypnos 278774b072 Add includedir to pkg-config file
Without this line, pkg-config 0.29.2 refuses to parse the arpack.pc file:

# pkg-config --libs arpack
Variable 'includedir' not defined in '/usr/lib/pkgconfig/arpack.pc'
2018-05-29 11:41:34 -07:00
Darcy Beurle d5153b941f Remove last comment 2018-05-22 14:43:00 +02:00
Darcy Beurle 34a81d09fb Remove _c and dead comments. Apply formatting. 2018-05-22 14:43:00 +02:00
Denis Davydov 834c9c53e3 add missing header (#120) 2018-05-22 14:41:27 +02:00
Darcy Beurle 079ca38ee6 Update CHANGES (#118) 2018-05-21 11:40:47 +02:00
Darcy Beurle 74784a5309 Add C++11 interface (#117) 2018-05-21 10:31:12 +02:00
Darcy Beurle d7deefda82 Add clang-format using the Google coding style (#116) 2018-05-20 23:31:47 +02:00
Sylvestre Ledru 534d6272d8 Merge pull request #113 from dbeurle/master
Test C++11 support on travis for autotools
2018-04-18 22:47:07 +02:00
Darcy Beurle 69f5411c1c Test C++11 support on travis for autotools 2018-04-18 22:32:47 +02:00
Sylvestre Ledru 9f6945657c Merge pull request #112 from dbeurle/master
Provide extern "C" when using C++ compiler for the C bindings
2018-04-18 22:00:55 +02:00
Darcy Beurle 33024f7d78 Provide extern "C" when using C++ compiler for the C bindings 2018-04-18 21:49:10 +02:00
Sylvestre Ledru 39258b58d4 Merge pull request #109 from fghoussen/icb_stat
iso_c_binding: add statistics support.
2018-04-12 16:54:17 +02:00
Sylvestre Ledru f686312826 Merge pull request #111 from fghoussen/cmake
[BUG FIX] CMake: test names should be different from exe names.
2018-04-12 16:46:56 +02:00
Franck HOUSSEN 9ffcb48193 [BUG FIX] CMake: test names should be different from exe names. 2018-04-12 16:03:05 +02:00
Sylvestre Ledru 194be499be Merge pull request #110 from fghoussen/cmake
CMake: merge "make test" and "make check"
2018-04-12 15:51:59 +02:00
Franck HOUSSEN 4db49c4687 CMake: kill "make check" as it's fully covered by "make test".
make check (autotools way) <=> make test ARGS="-V" (cmake way).
2018-04-12 13:16:22 +02:00
Franck HOUSSEN aaa357d96d CMake: get 100% tests OK when running "make test".
Kill EXCLUDE_FROM_ALL. Test name != executable name.
2018-04-12 13:09:14 +02:00
Franck HOUSSEN b521af291d iso_c_binding: README.md. 2018-04-11 18:40:43 +02:00
Franck HOUSSEN d67b323399 iso_c_binding: add statistics support. 2018-04-09 17:54:03 +02:00
Sylvestre Ledru 18e6709a2b Merge pull request #107 from fghoussen/icb_dbg
iso_c_binding: add debug support.
2018-04-08 14:27:06 +02:00
Sylvestre Ledru 87178d7ce1 Merge pull request #108 from fghoussen/ignore
Add bug_79_double_complex in .gitignore.
2018-04-08 10:39:34 +02:00
Franck HOUSSEN 76b5c5017a Initialize debug common block with "block data" (at Fortran side). 2018-04-08 10:37:02 +02:00
Franck HOUSSEN 2652660765 [BUG FIX] : debug.h should always be installed. 2018-04-07 22:44:57 +02:00
Franck HOUSSEN 5829df36a7 Add bug_79_double_complex in .gitignore. 2018-04-07 21:56:03 +02:00
Franck HOUSSEN be538c87c2 Revert "Move init debug common block from debug_icb.f90 to debug.h : this way you"
This reverts commit 22d1b3b0b5.
2018-04-07 17:21:38 +02:00
Franck HOUSSEN 22d1b3b0b5 Move init debug common block from debug_icb.f90 to debug.h : this way you
should benefit from that whatever you use (or not !) icb.
2018-04-07 17:16:09 +02:00
Franck HOUSSEN 64f3c1b8dc Initialisation of the debug common block to "no debug". 2018-04-07 17:04:39 +02:00
Franck HOUSSEN a9c71f3180 iso_c_binding : debug - stupid coverage....
CI fails because of -0.2% coveralls reg + noticed that cnappas.f and
friend are NOT fully covered => turn ALL flags to 1 hoping this will
get back a +0.2% coverage...
2018-04-07 16:53:36 +02:00
Franck HOUSSEN 533b9487b0 iso_c_binding : debug - cosmetic changes hoping the coverage
will get back from 69.8 to 70 % !...
2018-04-07 16:16:49 +02:00
Franck HOUSSEN 40ed22e42f iso_c_binding: debug - examples with and without debug traces. 2018-04-06 22:25:50 +02:00
Franck HOUSSEN 449ae6b95a iso_c_binding: add debug support. 2018-04-05 18:47:35 +02:00
Sylvestre Ledru ececcc167b Merge pull request #106 from fghoussen/cmake
CMake: cmake files install.
2018-04-05 15:25:29 +02:00
Franck HOUSSEN 2ed9d33a13 CMake: cmake files install.
find_package files (*.cmake) stand for pkg-config files (*.pc).
pc files are supposed to be installed in local/lib/pkgconfig.
cmake files are supposed to be installed in local/lib/cmake.
2018-04-05 10:31:02 +02:00
Sylvestre Ledru edce634363 Merge pull request #105 from luzpaz/misc-typos
Misc. typos
2018-04-04 09:05:17 +02:00
luz.paz 442e2ee534 Misc. typos
Found via `codespell -q 3`
2018-04-03 18:46:31 -04:00
Sylvestre Ledru 431d45b5a2 update of the makefile as the readme as be renamed 2018-03-26 00:41:48 +02:00
Sylvestre Ledru 5360fb7885 Fix the syntax 2018-03-26 00:31:57 +02:00
Sylvestre Ledru f3974f9720 Update of the doc to use markdown 2018-03-26 00:28:40 +02:00
Sylvestre Ledru 4d26789a53 Merge franck work 2018-03-26 00:21:08 +02:00
Sylvestre Ledru a07c391906 Detail the code coverage change 2018-03-26 00:20:22 +02:00
Sylvestre Ledru 930b29d6ce add badges about the quality 2018-03-26 00:19:21 +02:00
Sylvestre Ledru c92f5d63d4 cosmetic 2018-03-26 00:19:21 +02:00
Sylvestre Ledru 95997a6cf0 Rename the readme to markdown 2018-03-26 00:19:21 +02:00
Sylvestre Ledru cf62285f34 Merge pull request #103 from sylvestre/master
Fix the management of files without code coverage
2018-03-26 00:14:06 +02:00
Sylvestre Ledru e78134a671 remove trailing spaces 2018-03-26 00:03:27 +02:00
Sylvestre Ledru 72163e85b8 fix the empty file processing 2018-03-26 00:03:15 +02:00
Sylvestre Ledru df740d197f Merge pull request #102 from sylvestre/master
Try to add code coverage
2018-03-25 19:14:35 +02:00
Sylvestre Ledru 3073998f84 Build as many things as possible 2018-03-25 16:46:01 +02:00
Sylvestre Ledru b347211d95 how to build with code coverage 2018-03-25 15:57:11 +02:00
Sylvestre Ledru 84bd771150 Update travis to start the code coverage builds 2018-03-25 15:52:02 +02:00
Sylvestre Ledru f8754b29bc Try to add code coverage 2018-03-25 15:47:44 +02:00
Franck HOUSSEN 54c8e0b18c autotools: run parpack tests with "mpirun -n 2". (#101) 2018-03-24 18:39:25 +01:00
Franck HOUSSEN b52efe5f2c parpack: configuration check (use iso_c_binding, MPI_Comm_c2f). (#100)
* parpack: check for MPI_Comm_c2f.

* iso_c_binding: check for icb module compilation.
2018-03-23 11:39:15 +01:00
Franck HOUSSEN 4985c11b19 parpack: running autotools tests. (#99)
note: ax_mpi must be ran twice (first run in --enable-mpi scope
is lost when entering --enable-icb scope).
2018-03-22 15:27:38 +01:00
Franck HOUSSEN 6c1bd3053d [BUG FIX] CMake: use ${PROJECT_SOURCE_DIR}. (#97)
.. is OK only when the BUILD dir in under the root dir.
2018-03-21 17:54:43 +01:00
Franck HOUSSEN 2daaeaf2e9 TravisCI: kill libc++-dev. (#96) 2018-03-21 16:26:50 +01:00
Franck HOUSSEN 7bdcee1b23 parpack : add iso_c_binding support. (#95) 2018-03-21 13:24:10 +01:00
Darcy Beurle 946dc3db7b Test imaginary eigenvalue (#91) 2018-03-12 20:19:57 +01:00
Denis Davydov 70af492b6f cmake: use standard BUILD_SHARED_LIBS to control static vs shared (#94) 2018-03-12 15:42:43 +01:00
Franck HOUSSEN 264603d284 arpack.hpp: adding comments. (#93) 2018-03-12 15:21:36 +01:00
Sylvestre Ledru 6752fbca20 fix more typos 2018-03-10 17:05:05 +01:00
Darcy Beurle 7fc42e5f77 Fixed header typo (#92) 2018-03-10 17:01:56 +01:00
Franck HOUSSEN 3e841c8b13 Add CMake build directories in .gitignore. (#90) 2018-03-10 16:26:30 +01:00
Franck HOUSSEN f14261dcb0 arpack.hpp: add const to improve C++ integration. (#89)
note: as const is added on function arguments, this should be safe from C <-> C++ pitfalls.
2018-03-10 16:26:14 +01:00
caliarim d04bdf19b9 Force the residual vector to be in the range of OP. (#79) (#80)
* Force the residual vector to be in the range of OP. (#79)

Force the residual vector to be in the range of the operator OP for bmar .eq. 'I', too.
2018-03-02 12:36:47 +01:00
Ruslan Kabatsayev cd6366097d Fix C and C++ bindings ABI (#84)
Fortran's logical type has size of 4 bytes, while C and C++ have
sizeof(bool)==1. Thus it's no good to pass bool[ncv] array to a function
expecting logical(ncv).
Currently attempt to do this results in successful compilation and
subsequent buffer overflow in e.g. dseupd_c. This is actually caught at
run time by gcc>=5 by its stack smashing detector, leading to test
failures.
This patch replaces bool* types expected by C and C++ bindings with
int*, and corresponding declarations of the arrays in callers in the
tests from bool[3*ncv] to int[ncv].
This fixes #83.
2018-03-02 11:54:50 +01:00
Denis Davydov db1d49b60f rename pslamch to pslamch10 to avoid symbol collision with Scalapack (#85) 2018-03-02 11:54:35 +01:00
Franck HOUSSEN 1d912add4f CMake: kill useless lines (coming from bad merge ?). (#78) 2017-11-09 10:43:11 +01:00
Sylvestre Ledru ebe3091d8e Update CHANGES 2017-10-31 09:07:16 +01:00
Franck HOUSSEN 2f721dbade Issue 62: generate static/shared libraries. (#75) 2017-10-29 21:48:55 +01:00
Franck HOUSSEN 0e7d01d34b CMake: find_package for both parpack and arpack. (#76)
/tmp> cp /path/to/arpack-ng/PARPACK/EXAMPLES/MPI/*.f .
/tmp> cp /path/to/arpack-ng/PARPACK/EXAMPLES/MPI/*.h .

/tmp> more CMakeLists.txt
cmake_minimum_required(VERSION 3.7)
project(pdndrv1 Fortran)
find_package(MPI REQUIRED)
find_package(arpack-ng 3.5 REQUIRED)
find_package(BLAS REQUIRED)
find_package(LAPACK REQUIRED)
add_executable(pdndrv1 pdndrv1.f)
target_link_libraries(pdndrv1 "${arpack_ng_LIBRARIES}" "${MPI_Fortran_LIBRARIES}" "${BLAS_LIBRARIES}" "${LAPACK_LIBRARIES}")
target_include_directories(pdndrv1 PUBLIC "${arpack_ng_INCLUDE_DIRS}" "${MPI_Fortran_INCLUDE_PATH}")

/tmp> export CMAKE_PREFIX_PATH=/path/to/arpack-ng/local # Should be done by module load.

/tmp> mkdir BUILD; cd BUILD; cmake ..; make

/tmp> mpirun -n 2 ./pdndrv1
2017-10-29 21:48:38 +01:00
luzpaz 59bd5543e9 Fixed some trivial comment code typos (#77)
Found them in a downstream project and decided to submit fixes upstream.
2017-10-29 21:47:42 +01:00
Franck HOUSSEN da46ff3d4b Provide tarball generation using cmake (cpack). (#70)
Provide tarball generation using cmake (cpack)
2017-10-26 16:56:06 +02:00
Franck HOUSSEN 282fe8aa79 Run the testsuite in the CI with cmake. Fixes issue #64. 2017-10-26 15:49:37 +02:00
Franck HOUSSEN 19ac60166b Improve iso_c_binding coverage (#73)
* Provide arpack.h/hpp in install directory.

>> tree local/
local/
├── include
│   ├── arpack.h
│   └── arpack.hpp
└── lib
    ├── libarpack.a
    ...

* [BUG FIX] Provide arpack.h/hpp in install directory: fix make distcheck.

* Move iso_c_binding to icb_arpack.
This will ease iso_c_binding implementation for parpack (future dev).

* Improve iso_c_binding coverage. Add tests involving complex.
2017-10-26 11:46:24 +02:00
Sylvestre Ledru 79f7ecc4ed Merge the work from Franck under a single item 2017-10-16 17:48:22 +02:00
Franck HOUSSEN 771cbbd9c8 Add support for iso_c_binding (portability, f/c/c++ binding). (#68)
* Add support for iso_c_binding (portability, f/c/c++ binding).

* Add support for iso_c_binding: add README and comment examples.
2017-10-16 17:47:23 +02:00
Sylvestre Ledru c5102cd602 Next version will be 3.6.0 2017-10-16 14:49:05 +02:00
Sylvestre Ledru 6fd243b674 Fix consistency issues over the arpack name (#71) 2017-10-16 14:47:01 +02:00
Franck HOUSSEN be3a61cfee Provide find_package for (cmake) users to find arpack-ng. (#69)
This is the cmake equivalent of pkg-config.

The make install will ship config files:
/path/to/arpack-ng/BUILD> cmake ..; make install
[100%] Built target arpack
Install the project...
-- Install configuration: "Release"
-- Installing: /path/to/arpack-ng/local/lib/libarpack.a
-- Installing: /path/to/arpack-ng/local/*[Cc]onfig*.cmake

Now, the user who wants to use arpack-ng can use find_package:

/tmp> export CMAKE_PREFIX_PATH="/path/to/arpack-ng/local:${CMAKE_PREFIX_PATH}" # Should be done by module load arpack-ng.

/tmp> more CMakeLists.txt
cmake_minimum_required(VERSION 3.7)
find_package(arpack-ng 3.5 REQUIRED) # Find *Config*.cmake.

/tmp> mkdir BUILD; cd BUILD; cmake ..
...
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/BUILD

/tmp/BUILD> cmake -LA .. | grep Arpack
ArpackNG_DIR:PATH=/path/to/arpack-ng/local
ArpackNG_INCLUDE_DIRS:PATH=/path/to/arpack-ng/local/include
ArpackNG_LIBRARIES:FILEPATH=/path/to/arpack-ng/local/lib/libarpack.a

The user can use ArpackNG_INCLUDE_DIRS and ArpackNG_LIBRARIES to compile/link with arpack-ng in his own CMakeLists.txt (after find_package).

If the user asks for an newer version, cmake breaks at configure time: this is checked by ArpackNGConfigVersion.cmake.
2017-10-16 14:38:51 +02:00
Edward Betts 7a91e3a665 correct spelling mistakes (#67) 2017-08-31 07:31:09 +02:00
adamadanandy 5820b39ade fix {d|s}lahqr comment, which should be LAPACK routine (#66) 2017-08-19 19:28:32 +02:00
turboencabulator 616a91547d Minor autoconf cleanup (#61)
* Move some generated files to build-aux

* Remove unnecessary includes

aclocal handles these includes.

* Update changelog

* Update .gitignore
2017-07-02 15:23:28 -07:00
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
162 changed files with 7050 additions and 548 deletions
+1
View File
@@ -0,0 +1 @@
BasedOnStyle: Google
+17 -7
View File
@@ -3,16 +3,11 @@
# Generated by `autoreconf`
Makefile.in
aclocal.m4
configure
autom4te.cache/
build-aux/
m4/libtool.m4
m4/lt*.m4
configure
config.guess
config.sub
depcomp
install-sh
ltmain.sh
missing
# Generated by `./configure`
Makefile
@@ -24,15 +19,27 @@ arpack.pc
# Generated by `make`
*.o
*.mod
*.lo
*.la
.libs/
# CMake build directories
BUILD
Build
build
# Generated by `make check`
*.log
*.trs
TESTS/dnsimp
TESTS/bug_1315_double
TESTS/bug_1315_single
TESTS/bug_1323
TESTS/bug_58_double
TESTS/bug_79_double_complex
TESTS/icb_arpack_c
TESTS/icb_arpack_cpp
EXAMPLES/BAND/[sd][sn]bdr[123456]
EXAMPLES/BAND/[cz]nbdr[1234]
EXAMPLES/COMPLEX/[cz]ndrv[1234]
@@ -44,6 +51,9 @@ EXAMPLES/SYM/[sd]sdrv[123456]
PARPACK/EXAMPLES/MPI/p[sd]ndrv[13]
PARPACK/EXAMPLES/MPI/p[sd]sdrv1
PARPACK/EXAMPLES/MPI/p[cz]ndrv1
PARPACK/TESTS/MPI/icb_parpack_c
PARPACK/TESTS/MPI/icb_parpack_cpp
PARPACK/TESTS/MPI/issue46
*.lib
*.def
+59 -6
View File
@@ -9,14 +9,67 @@ addons:
apt:
packages:
- gfortran
- libopenblas-dev
- gcc
- g++
- libblas-dev
- liblapack-dev
- libopenmpi-dev
- openmpi-bin
env:
- BUILD=cmake
- BUILD=configure
script:
- ./bootstrap
- ./configure --enable-mpi
- make all
- make check
- make distcheck
# CMAKE
- 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 -D ICB=OFF .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D EXAMPLES=ON -D MPI=ON -D ICB=ON .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D EXAMPLES=ON -D MPI=OFF -D ICB=OFF .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D EXAMPLES=ON -D MPI=OFF -D ICB=ON .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D BUILD_SHARED_LIBS=ON -D MPI=ON -D ICB=OFF .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D BUILD_SHARED_LIBS=ON -D MPI=ON -D ICB=ON .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D BUILD_SHARED_LIBS=ON -D MPI=OFF -D ICB=OFF .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch.
- if [ "$BUILD" == "cmake" ]; then cmake -D BUILD_SHARED_LIBS=ON -D MPI=OFF -D ICB=ON .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all ; fi
- if [ "$BUILD" == "cmake" ]; then make test ; fi
- if [ "$BUILD" == "cmake" ]; then rm -fr * ; fi # Restart cmake from scratch for code coverage
- if [ "$BUILD" == "cmake" ]; then cmake -D EXAMPLES=ON -DCOVERALLS=ON -D MPI=ON -D ICB=ON .. ; fi
- if [ "$BUILD" == "cmake" ]; then make all test coveralls VERBOSE=1 ; 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
- if [ "$BUILD" == "configure" ]; then ./configure --enable-mpi --enable-icb ; fi
- if [ "$BUILD" == "configure" ]; then make all ; fi
- if [ "$BUILD" == "configure" ]; then make check ; fi
- if [ "$BUILD" == "configure" ]; then ./configure --enable-icb ; fi
- if [ "$BUILD" == "configure" ]; then make all ; fi
- if [ "$BUILD" == "configure" ]; then make check ; fi
- if [ "$BUILD" == "configure" ]; then ./configure ; fi
- if [ "$BUILD" == "configure" ]; then make all ; fi
- if [ "$BUILD" == "configure" ]; then make check ; fi
+81 -3
View File
@@ -1,4 +1,82 @@
arpack-ng - 3.6.0
[ Franck Houssen ]
* Add support for ISO_C_BINDING (Fortran 2003) for ARPACK, PARPACK (Fortran <-> C/C++).
ARPACK: example of C/Fortran binding can be found in the TESTS/icb_arpack_c.c file.
ARPACK: example of C++/Fortran binding can be found in the TESTS/icb_arpack_cpp.cpp file.
PARPACK: example of C/Fortran binding can be found in the PARPACK/TESTS/MPI/icb_parpack_c.c file.
PARPACK: example of C++/Fortran binding can be found in the PARPACK/TESTS/MPI/icb_parpack_cpp.cpp file.
DEBUG: add support for debug.
STAT: add support for statistics (timers, nb operations, ...).
* Provide tarball generation using cmake (cpack).
* Provide find_package for (cmake) users to find arpack-ng.
[ Denis Davydov ]
* Rename pslamch to pslamch10 to avoid symbol collision with Scalapack 2.0.2 in MPI context.
[ Kyle Guinn ]
* Autoconf cleanup; move generated files to the build-aux subdirectory.
[ Marco Caliari ]
* Force the initial residual to be in the range of the operator OP in the standard case, too (Closes: #79).
[ Sylvestre Ledru ]
* Add coverage information to improve testing: https://coveralls.io/github/opencollab/arpack-ng
[ Darcy Beurle]
* Add C++11 interface through arpack.hpp and parpack.hpp
* Rewrite C++ examples / tests demonstrating new C++11 interface
* Pre-C++11 interface available through arpack.h and parpack.h
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 30 Oct 2017 14:21:48 +0200
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 +84,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)
@@ -85,7 +163,7 @@ arpack-ng - 3.1.2
* Wrong call to pdlamch was causing segfaults
Thanks to Kyrre Sjøbæk for finding the bug and the fix.
* Get rid of the mpif.h occurences in the source code (Closes: #782)
* Get rid of the mpif.h occurrences in the source code (Closes: #782)
* Compile also PARPACK / MPI example (Closes: #783)
* Configure detected built-in LAPACK and BLAS, but refused to use them
(Closes: #784)
@@ -110,7 +188,7 @@ arpack-ng - 3.1.0
* Change the bug report from arpack@caam.rice.edu to
http://forge.scilab.org/index.php/p/arpack-ng/issues/
* Provide a M4 macro (detect_arpack_bug.m4) to check if the underlying
arpack is buggy (ie not arpack-ng). This allows developper applications
arpack is buggy (ie not arpack-ng). This allows developer applications
to perform the check in their autotools build system (configure).
* Fixed a lack of appropriate bounds check in DNAUP2. Thanks to Pauli Virtanen
for the patch (Closes: #632)
+573
View File
@@ -0,0 +1,573 @@
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)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
# 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(ICB "Enable support for *[ae]upd_c with ISO_C_BINDING" 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)
if (COVERALLS)
include(Coveralls)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
set(EXTRA_LDLAGS "${EXTRA_LDLAGS}-lgcov")
endif()
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} ${EXTRA_LDLAGS})
add_test(NAME "${lwe}_ex" COMMAND ${lwe} WORKING_DIRECTORY ${arpackexample_DIR})
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)
# Enable language(s) before any find_package (in particular before MPI find_package).
if (ICB)
enable_language(C CXX) # For testing binding with c/c++.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90
"
PROGRAM PROG_ICB
USE iso_c_binding
IMPLICIT NONE
INTEGER(C_INT) :: a
a = 1
END PROGRAM PROG_ICB
")
try_compile(COMPILE_ICB ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/PROG_ICB.f90)
if(NOT ${COMPILE_ICB})
message(FATAL_ERROR "-- Fortran compiler does not support iso_c_binding.")
else()
message("-- Fortran compiler does support iso_c_binding.")
endif()
endif()
#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}")
if(ICB)
include_directories(${MPI_C_INCLUDE_PATH})
check_symbol_exists(MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" MPI_Comm_c2f_FOUND)
if(NOT ${MPI_Comm_c2f_FOUND})
message(FATAL_ERROR "symbol MPI_Comm_c2f does not exist")
endif()
endif()
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 ${arpack_SOURCE_DIR}/SRC/*.f)
set(arpacksrc_ICB "")
set(parpacksrc_ICB "")
if(ICB)
file(GLOB arpacksrc_ICB SRC/icba*.f90 debug_init.f90 debug_icb.f90 stat_icb.f90)
file(GLOB parpacksrc_ICB PARPACK/SRC/MPI/icbp*.f90 debug_init.f90 debug_icb.f90 stat_icb.f90)
endif()
set(arpackutil_STAT_SRCS
${arpack_SOURCE_DIR}/UTIL/icnteq.f
${arpack_SOURCE_DIR}/UTIL/icopy.f
${arpack_SOURCE_DIR}/UTIL/iset.f
${arpack_SOURCE_DIR}/UTIL/iswap.f
${arpack_SOURCE_DIR}/UTIL/ivout.f
${arpack_SOURCE_DIR}/UTIL/second_NONE.f
${arpack_SOURCE_DIR}/UTIL/svout.f
${arpack_SOURCE_DIR}/UTIL/smout.f
${arpack_SOURCE_DIR}/UTIL/dvout.f
${arpack_SOURCE_DIR}/UTIL/dmout.f
${arpack_SOURCE_DIR}/UTIL/cvout.f
${arpack_SOURCE_DIR}/UTIL/cmout.f
${arpack_SOURCE_DIR}/UTIL/zvout.f
${arpack_SOURCE_DIR}/UTIL/zmout.f )
if (MPI)
file(GLOB parpackutil_STAT_SRCS PARPACK/UTIL/MPI/*.f)
file(GLOB parpacksrc_STAT_SRCS PARPACK/SRC/MPI/*.f)
endif()
# use -DBUILD_SHARED_LIBS=ON|OFF to control static/shared
add_library(arpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB})
if(ICB)
install(FILES arpack.h DESTINATION include)
install(FILES arpack.hpp DESTINATION include)
if (MPI)
install(FILES parpack.h DESTINATION include)
install(FILES parpack.hpp DESTINATION include)
endif()
endif()
install(FILES debug.h DESTINATION include)
if(ICB)
install(FILES debug_c.h DESTINATION include)
install(FILES debug_c.hpp DESTINATION include)
endif()
install(FILES stat.h DESTINATION include)
if(ICB)
install(FILES stat_c.h DESTINATION include)
install(FILES stat_c.hpp DESTINATION include)
endif()
target_link_libraries(arpack ${BLAS_LIBRARIES})
target_link_libraries(arpack ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
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)
# use -DBUILD_SHARED_LIBS=ON|OFF to control static/shared
add_library(parpack ${parpacksrc_STAT_SRCS} ${parpackutil_STAT_SRCS} ${parpacksrc_ICB})
if (ICB)
target_include_directories(parpack PUBLIC ${MPI_C_INCLUDE_DIRS})
target_include_directories(parpack PUBLIC ${MPI_CXX_INCLUDE_DIRS})
target_link_libraries(parpack ${MPI_C_LIBRARIES})
target_link_libraries(parpack ${MPI_CXX_LIBRARIES})
endif()
target_include_directories(parpack PUBLIC ${MPI_Fortran_INCLUDE_DIRS})
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()
############################
# TEST
############################
enable_testing()
set(CMAKE_CTEST_COMMAND ctest -V)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Tests)
add_executable(dnsimp_test 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} ${EXTRA_LDLAGS})
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_tst Tests/dnsimp)
add_executable(bug_1315_single TESTS/bug_1315_single.c)
target_link_libraries(bug_1315_single arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(bug_1315_single_tst Tests/bug_1315_single)
add_executable(bug_1315_double TESTS/bug_1315_double.c)
target_link_libraries(bug_1315_double arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(bug_1315_double_tst Tests/bug_1315_double)
add_executable(bug_1323 TESTS/bug_1323.f)
target_link_libraries(bug_1323 arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(bug_1323_tst Tests/bug_1323)
add_executable(bug_58_double TESTS/bug_58_double.f)
target_link_libraries(bug_58_double arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(bug_58_double_tst Tests/bug_58_double)
add_executable(bug_79_double_complex TESTS/bug_79_double_complex.f)
target_link_libraries(bug_79_double_complex arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(bug_79_double_complex_tst Tests/bug_79_double_complex)
if(MPI)
add_executable(issue46 PARPACK/TESTS/MPI/issue46.f)
target_link_libraries(issue46 parpack arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(issue46_tst Tests/issue46)
endif()
if(ICB)
add_executable(icb_arpack_c TESTS/icb_arpack_c.c)
target_include_directories(icb_arpack_c PUBLIC ${PROJECT_SOURCE_DIR}) # Get arpack.h
target_link_libraries(icb_arpack_c arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(icb_arpack_c_tst Tests/icb_arpack_c)
add_executable(icb_arpack_cpp TESTS/icb_arpack_cpp.cpp)
target_include_directories(icb_arpack_cpp PUBLIC ${PROJECT_SOURCE_DIR}) # Get arpack.hpp
target_link_libraries(icb_arpack_cpp arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS})
add_test(icb_arpack_cpp_tst Tests/icb_arpack_cpp)
if (MPI)
add_executable(icb_parpack_c PARPACK/TESTS/MPI/icb_parpack_c.c)
target_include_directories(icb_parpack_c PUBLIC ${PROJECT_SOURCE_DIR} ${MPI_C_INCLUDE_DIRS}) # Get parpack.h mpi.h
target_link_libraries(icb_parpack_c parpack arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS} ${MPI_C_LIBRARIES})
add_test(icb_parpack_c_tst mpirun -n 2 Tests/icb_parpack_c)
add_executable(icb_parpack_cpp PARPACK/TESTS/MPI/icb_parpack_cpp.cpp)
target_include_directories(icb_parpack_cpp PUBLIC ${PROJECT_SOURCE_DIR} ${MPI_CXX_INCLUDE_DIRS}) # Get parpack.hpp mpi.h
target_link_libraries(icb_parpack_cpp parpack arpack ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES} ${EXTRA_LDLAGS} ${MPI_CXX_LIBRARIES})
add_test(icb_parpack_cpp_tst mpirun -n 2 Tests/icb_parpack_cpp)
endif()
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 ()
# Provide find_package for arpack-ng to users.
configure_file(arpack-ng-config.cmake.in "${PROJECT_BINARY_DIR}/arpack-ng-config.cmake" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpack-ng-config.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake") # find_package(arpack-ng)
set(arpack_ng_MAJOR_VERSION 3)
set(arpack_ng_MINOR_VERSION 6)
set(arpack_ng_PATCH_VERSION 0)
set(arpack_ng_VERSION ${arpack_ng_MAJOR_VERSION}.${arpack_ng_MINOR_VERSION}.${arpack_ng_PATCH_VERSION})
configure_file(arpack-ng-config-version.cmake.in "${PROJECT_BINARY_DIR}/arpack-ng-config-version.cmake" @ONLY)
install(FILES "${PROJECT_BINARY_DIR}/arpack-ng-config-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake")
# Packaging: ease arpack-ng distribution (precompiled binaries and sources tarballs).
set(CPACK_VERSION_MAJOR "${arpack_ng_MAJOR_VERSION}")
set(CPACK_VERSION_MINOR "${arpack_ng_MINOR_VERSION}")
set(CPACK_VERSION_PATCH "${arpack_ng_PATCH_VERSION}")
set(CPACK_SOURCE_IGNORE_FILES "/BUILD/" "/Build/" "/build/" "/local/") # Do not ship (eventual) build or install directories in tarballs.
set(CPACK_SOURCE_PACKAGE_FILE_NAME "arpack-ng-${CPACK_VERSION_MAJOR}.${CPACK_VERSION_MINOR}.${CPACK_VERSION_PATCH}")
include(CPack)
# We don't want this to run on every build.
option(COVERALLS "Generate coveralls data" OFF)
if (COVERALLS)
set(COVERAGE_SRCS awesome.c code.c files.c)
# Create the coveralls target.
coveralls_setup(
"${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB}" # The source files.
ON # If we should upload.
"${PROJECT_SOURCE_DIR}/cmake/") # (Optional) Alternate project cmake module path.
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.
+2 -2
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
@@ -13,7 +13,7 @@ TESTS = $(check_PROGRAMS)
EXTRA_DIST = README
# Simple symetric problem using BAND solver (single precision)
# Simple symmetric problem using BAND solver (single precision)
ssbdr1_SOURCES = ssbdr1.f ssband.f
ssbdr2_SOURCES = ssbdr2.f ssband.f
ssbdr3_SOURCES = ssbdr3.f ssband.f
+1 -1
View File
@@ -158,7 +158,7 @@ c Stopping criteria: the relative accuracy of the Ritz value
c is considered acceptable if BOUNDS(I) .LE. TOL*ABS(RITZ(I))
c where ABS(RITZ(I)) is the magnitude when RITZ(I) is complex.
c DEFAULT = slamch('EPS') (machine precision as computed
c by the LAPACK auxilliary subroutine slamch).
c by the LAPACK auxiliary subroutine slamch).
c
c RESID Complex array of length N. (INPUT/OUTPUT)
c On INPUT:
+1 -1
View File
@@ -158,7 +158,7 @@ c Stopping criteria: the relative accuracy of the Ritz value
c is considered acceptable if BOUNDS(I) .LE. TOL*ABS(RITZ(I))
c where ABS(RITZ(I)) is the magnitude when RITZ(I) is complex.
c DEFAULT = dlamch ('EPS') (machine precision as computed
c by the LAPACK auxilliary subroutine dlamch ).
c by the LAPACK auxiliary subroutine dlamch ).
c
c RESID Complex*16 array of length N. (INPUT/OUTPUT)
c On INPUT:
+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
@@ -0,0 +1,2 @@
In ../TESTS, the file icb_arpack_c.c is an example of how to call arpack from C.
In ../TESTS, the file icb_arpack_cpp.cpp is an example of how to call arpack from C++.
+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
+28 -26
View File
@@ -1,32 +1,34 @@
SUBDIRS = UTIL SRC . TESTS EXAMPLES
if MPI
SUBDIRS += PARPACK
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-mpi
endif
lib_LTLIBRARIES = libarpack.la
ACLOCAL_AMFLAGS = -I m4
libarpack_la_SOURCES =
AM_DISTCHECK_CONFIGURE_FLAGS =
if MPI
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-mpi
endif
include_HEADERS = debug.h stat.h
if ICB
AM_DISTCHECK_CONFIGURE_FLAGS += --enable-icb
include_HEADERS += debug_c.h debug_c.hpp
include_HEADERS += stat_c.h stat_c.hpp
include_HEADERS += arpack.h arpack.hpp
if MPI
include_HEADERS += parpack.h parpack.hpp
endif
endif
# 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
SUBDIRS = UTIL SRC . TESTS EXAMPLES PARPACK
libarpack_la_LDFLAGS = -no-undefined -version-info 2:0
EXTRA_DIST = README.md PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \
detect_arpack_bug.m4 CMakeLists.txt arpack-ng-config.cmake.in arpack-ng-config-version.cmake.in \
debug.h stat.h
if ICB
EXTRA_DIST += debug_c.h debug_c.hpp
EXTRA_DIST += stat_c.h stat_c.hpp
EXTRA_DIST += arpack.h arpack.hpp
if MPI
EXTRA_DIST += parpack.h parpack.hpp
endif
endif
libarpack_la_LIBADD = \
$(top_builddir)/SRC/libarpacksrc.la \
$(top_builddir)/UTIL/libarpackutil.la \
$(LAPACK_LIBS) $(BLAS_LIBS)
pkgconfig_DATA = arpack@LIBSUFFIX@.pc
EXTRA_DIST = README PARPACK_CHANGES CHANGES DOCUMENTS VISUAL_STUDIO \
detect_arpack_bug.m4
# Pkgconfig directory
pkgconfigdir = $(libdir)/pkgconfig
# 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
@@ -0,0 +1,2 @@
In PARPACK/TESTS/MPI, the file icb_parpack_c.c is an example of how to call parpack from C.
In PARPACK/TESTS/MPI, the file icb_parpack_cpp.cpp is an example of how to call parpack from C++.
+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
@@ -225,7 +225,7 @@ c
cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
+1 -1
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Hessenberg matrix has split off and contains "unwanted"
c Ritz values.
+1 -1
View File
@@ -258,7 +258,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c User input error highly likely. Please
+1 -1
View File
@@ -1,6 +1,6 @@
DOUBLE PRECISION FUNCTION PDLAMCH( ICTXT, CMACH )
*
* -- ScaLAPACK auxilliary routine (version 1.0) --
* -- ScaLAPACK auxiliary routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
+1 -1
View File
@@ -398,7 +398,7 @@ c
c
c %---------------------------------------------------%
c | STEP 1: Check if the B norm of j-th residual |
c | vector is zero. Equivalent to determing whether |
c | vector is zero. Equivalent to determining whether |
c | an exact j-step Arnoldi factorization is present. |
c %---------------------------------------------------%
c
+3 -3
View File
@@ -34,7 +34,7 @@ c
c KEV Integer. (INPUT/OUTPUT)
c KEV+NP is the size of the input matrix H.
c KEV is the size of the updated matrix HNEW. KEV is only
c updated on ouput when fewer than NP shifts are applied in
c updated on output when fewer than NP shifts are applied in
c order to keep the conjugate pair together.
c
c NP Integer. (INPUT)
@@ -215,7 +215,7 @@ c
intrinsic abs, max, min
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
@@ -395,7 +395,7 @@ c
do 80 i = istart, iend-1
c
c %-----------------------------------------------------%
c | Contruct the plane rotation G to zero out the bulge |
c | Construct the plane rotation G to zero out the bulge |
c %-----------------------------------------------------%
c
call dlartg (f, g, c, s, r)
+2 -2
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV for two reasons. The first, is
c to keep complex conjugate pairs of "wanted" Ritz values
c together. The second, is that a leading block of the current
@@ -715,7 +715,7 @@ c
if (ishift .eq. 0) then
c
c %-------------------------------------------------------%
c | User specified shifts: reverse comminucation to |
c | User specified shifts: reverse communication to |
c | compute the shifts. They are returned in the first |
c | 2*NP locations of WORKL. |
c %-------------------------------------------------------%
+1 -1
View File
@@ -276,7 +276,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
+2 -2
View File
@@ -396,8 +396,8 @@ c
end if
c
c %---------------------------------------------------------%
c | Check for exact zero. Equivalent to determing whether a |
c | j-step Arnoldi factorization is present. |
c | Check for exact zero. Equivalent to determining whether |
c | a j-step Arnoldi factorization is present. |
c %---------------------------------------------------------%
c
if (rnorm .gt. zero) go to 40
+2 -2
View File
@@ -204,7 +204,7 @@ c
intrinsic abs
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
@@ -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
@@ -29,7 +29,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Tridiagonal matrix has split off and contains "unwanted"
c Ritz values.
+3 -3
View File
@@ -271,9 +271,9 @@ c = -8: Error return from trid. eigenvalue calculation;
c Informatinal error from LAPACK routine dsteqr .
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4,5.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -13: NEV and WHICH = 'BE' are incompatable.
c = -13: NEV and WHICH = 'BE' are incompatible.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
c factorization. The user is advised to check that
@@ -310,7 +310,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
+1 -1
View File
@@ -1,6 +1,6 @@
REAL FUNCTION PSLAMCH( ICTXT, CMACH )
*
* -- ScaLAPACK auxilliary routine (version 1.0) --
* -- ScaLAPACK auxiliary routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
+1 -1
View File
@@ -398,7 +398,7 @@ c
c
c %---------------------------------------------------%
c | STEP 1: Check if the B norm of j-th residual |
c | vector is zero. Equivalent to determing whether |
c | vector is zero. Equivalent to determining whether |
c | an exact j-step Arnoldi factorization is present. |
c %---------------------------------------------------%
c
+3 -3
View File
@@ -34,7 +34,7 @@ c
c KEV Integer. (INPUT/OUTPUT)
c KEV+NP is the size of the input matrix H.
c KEV is the size of the updated matrix HNEW. KEV is only
c updated on ouput when fewer than NP shifts are applied in
c updated on output when fewer than NP shifts are applied in
c order to keep the conjugate pair together.
c
c NP Integer. (INPUT)
@@ -215,7 +215,7 @@ c
intrinsic abs, max, min
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
@@ -395,7 +395,7 @@ c
do 80 i = istart, iend-1
c
c %-----------------------------------------------------%
c | Contruct the plane rotation G to zero out the bulge |
c | Construct the plane rotation G to zero out the bulge |
c %-----------------------------------------------------%
c
call slartg (f, g, c, s, r)
+2 -2
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV for two reasons. The first, is
c to keep complex conjugate pairs of "wanted" Ritz values
c together. The second, is that a leading block of the current
@@ -715,7 +715,7 @@ c
if (ishift .eq. 0) then
c
c %-------------------------------------------------------%
c | User specified shifts: reverse comminucation to |
c | User specified shifts: reverse communication to |
c | compute the shifts. They are returned in the first |
c | 2*NP locations of WORKL. |
c %-------------------------------------------------------%
+1 -1
View File
@@ -276,7 +276,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
+2 -2
View File
@@ -396,8 +396,8 @@ c
end if
c
c %---------------------------------------------------------%
c | Check for exact zero. Equivalent to determing whether a |
c | j-step Arnoldi factorization is present. |
c | Check for exact zero. Equivalent to determining whether |
c | a j-step Arnoldi factorization is present. |
c %---------------------------------------------------------%
c
if (rnorm .gt. zero) go to 40
+2 -2
View File
@@ -204,7 +204,7 @@ c
intrinsic abs
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
@@ -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
+1 -1
View File
@@ -29,7 +29,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Tridiagonal matrix has split off and contains "unwanted"
c Ritz values.
+3 -3
View File
@@ -271,9 +271,9 @@ c = -8: Error return from trid. eigenvalue calculation;
c Informatinal error from LAPACK routine ssteqr.
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4,5.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -13: NEV and WHICH = 'BE' are incompatable.
c = -13: NEV and WHICH = 'BE' are incompatible.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
c factorization. The user is advised to check that
@@ -310,7 +310,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
+1 -1
View File
@@ -225,7 +225,7 @@ c
cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
+1 -1
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Hessenberg matrix has split off and contains "unwanted"
c Ritz values.
+1 -1
View File
@@ -258,7 +258,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c User input error highly likely. Please
+26 -7
View File
@@ -1,7 +1,10 @@
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug_init/icb.f90 are not in current directory.
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 +19,29 @@ 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
if ICB
SSRC += icbpss.f90 icbpsn.f90
DSRC += icbpds.f90 icbpdn.f90
CSRC += icbpcn.f90
ZSRC += icbpzn.f90
endif
noinst_LTLIBRARIES = libparpack_noopt.la libparpacksrcmpi.la
EXTRA_DIST = debug.h stat.h pcontext.h
libparpack_noopt_la_SOURCES = pslamch.f pdlamch10.f
libparpack_noopt_la_FFLAGS = -O0
noinst_LTLIBRARIES = libparpack@LIBSUFFIX@_noopt.la
libparpack@LIBSUFFIX@_noopt_la_SOURCES = pslamch10.f pdlamch10.f
libparpack@LIBSUFFIX@_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_SOURCES += $(top_builddir)/debug_init.f90
if ICB
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_icb.f90
libparpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/stat_icb.f90
endif
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) $(MPI_Fortran_LIBS)
libparpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 2:0
+64
View File
@@ -0,0 +1,64 @@
! icbp : iso_c_binding for parpack
subroutine pcnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pcnaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float_complex), value, intent(in) :: tol
real(kind=c_float_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float_complex), dimension(3*n), intent(out) :: workd
real(kind=c_float_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_float_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pcnaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info)
end subroutine pcnaupd_c
subroutine pcneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pcneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_float_complex), dimension(nev), intent(out) :: d
real(kind=c_float_complex), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_float_complex), value, intent(in) :: sigma
real(kind=c_float_complex), dimension(2*ncv), intent(in) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float_complex), value, intent(in) :: tol
real(kind=c_float_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float_complex), dimension(3*n), intent(out) :: workd
real(kind=c_float_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_float_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pcneupd(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
iparam, ipntr, workd, workl, lworkl, rwork, info)
end subroutine pcneupd_c
+65
View File
@@ -0,0 +1,65 @@
! icbp : iso_c_binding for parpack
subroutine pdnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdnaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
real(kind=c_double), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double), dimension(3*n), intent(out) :: workd
real(kind=c_double), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call pdnaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine pdnaupd_c
subroutine pdneupd_c(comm, rvec, howmny, select, &
dr, di, z, ldz, sigmar, sigmai, &
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_double), dimension(nev+1), intent(out) :: dr
real(kind=c_double), dimension(nev+1), intent(out) :: di
real(kind=c_double), dimension(n, nev+1), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_double), value, intent(in) :: sigmar
real(kind=c_double), value, intent(in) :: sigmai
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
real(kind=c_double), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double), dimension(3*n), intent(out) :: workd
real(kind=c_double), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call pdneupd(comm, rvec, howmny, select, &
dr, di, z, ldz, sigmar, sigmai, &
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine pdneupd_c
+61
View File
@@ -0,0 +1,61 @@
! icbp : iso_c_binding for parpack
subroutine pdsaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdsaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
real(kind=c_double), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double), dimension(3*n), intent(out) :: workd
real(kind=c_double), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call pdsaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine pdsaupd_c
subroutine pdseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pdseupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_double), dimension(nev), intent(out) :: d
real(kind=c_double), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_double), value, intent(in) :: sigma
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double), value, intent(in) :: tol
real(kind=c_double), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double), dimension(3*n), intent(out) :: workd
real(kind=c_double), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call pdseupd(comm, rvec, howmny, select, d, z, ldz, sigma,&
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine pdseupd_c
+65
View File
@@ -0,0 +1,65 @@
! icbp : iso_c_binding for parpack
subroutine psnaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psnaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
real(kind=c_float), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float), dimension(3*n), intent(out) :: workd
real(kind=c_float), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call psnaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine psnaupd_c
subroutine psneupd_c(comm, rvec, howmny, select, &
dr, di, z, ldz, sigmar, sigmai, &
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_float), dimension(nev+1), intent(out) :: dr
real(kind=c_float), dimension(nev+1), intent(out) :: di
real(kind=c_float), dimension(n, nev+1), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_float), value, intent(in) :: sigmar
real(kind=c_float), value, intent(in) :: sigmai
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
real(kind=c_float), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float), dimension(3*n), intent(out) :: workd
real(kind=c_float), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call psneupd(comm, rvec, howmny, select, &
dr, di, z, ldz, sigmar, sigmai, &
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine psneupd_c
+61
View File
@@ -0,0 +1,61 @@
! icbp : iso_c_binding for parpack
subroutine pssaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="pssaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
real(kind=c_float), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float), dimension(3*n), intent(out) :: workd
real(kind=c_float), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call pssaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine pssaupd_c
subroutine psseupd_c(comm, rvec, howmny, select, d, z, ldz, sigma,&
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info) &
bind(c, name="psseupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_float), dimension(nev), intent(out) :: d
real(kind=c_float), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_float), value, intent(in) :: sigma
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_float), value, intent(in) :: tol
real(kind=c_float), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_float), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_float), dimension(3*n), intent(out) :: workd
real(kind=c_float), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
integer(kind=c_int), intent(inout) :: info
call psseupd(comm, rvec, howmny, select, d, z, ldz, sigma,&
bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, info)
end subroutine psseupd_c
+64
View File
@@ -0,0 +1,64 @@
! icbp : iso_c_binding for parpack
subroutine pznaupd_c(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pznaupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
integer(kind=c_int), intent(inout) :: ido
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double_complex), value, intent(in) :: tol
real(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double_complex), dimension(3*n), intent(out) :: workd
real(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pznaupd(comm, ido, bmat, n, which, nev, tol, resid, ncv, v, ldv,&
iparam, ipntr, workd, workl, lworkl, rwork, info)
end subroutine pznaupd_c
subroutine pzneupd_c(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
iparam, ipntr, workd, workl, lworkl, rwork, info) &
bind(c, name="pzneupd_c")
use :: iso_c_binding
implicit none
integer(kind=c_int), value, intent(in) :: comm
logical(kind=c_bool), value, intent(in) :: rvec
character(kind=c_char), dimension(1), intent(in) :: howmny
logical(kind=c_bool), dimension(ncv), intent(in) :: select
real(kind=c_double_complex), dimension(nev), intent(out) :: d
real(kind=c_double_complex), dimension(n, nev), intent(out) :: z
integer(kind=c_int), value, intent(in) :: ldz
real(kind=c_double_complex), value, intent(in) :: sigma
real(kind=c_double_complex), dimension(2*ncv), intent(in) :: workev
character(kind=c_char), dimension(1), intent(in) :: bmat
integer(kind=c_int), value, intent(in) :: n
character(kind=c_char), dimension(2), intent(in) :: which
integer(kind=c_int), value, intent(in) :: nev
real(kind=c_double_complex), value, intent(in) :: tol
real(kind=c_double_complex), dimension(n), intent(inout) :: resid
integer(kind=c_int), value, intent(in) :: ncv
real(kind=c_double_complex), dimension(ldv, ncv), intent(out) :: v
integer(kind=c_int), value, intent(in) :: ldv
integer(kind=c_int), dimension(11), intent(inout) :: iparam
integer(kind=c_int), dimension(11), intent(out) :: ipntr
real(kind=c_double_complex), dimension(3*n), intent(out) :: workd
real(kind=c_double_complex), dimension(lworkl), intent(out) :: workl
integer(kind=c_int), value, intent(in) :: lworkl
real(kind=c_double_complex), dimension(ncv), intent(out) :: rwork
integer(kind=c_int), intent(inout) :: info
call pzneupd(comm, rvec, howmny, select, d, z, ldz, sigma, workev,&
bmat, n, which, nev, tol, resid, ncv, v, ldv, &
iparam, ipntr, workd, workl, lworkl, rwork, info)
end subroutine pzneupd_c
+10 -10
View File
@@ -144,7 +144,7 @@ c clanhs LAPACK routine that computes various norms of a matrix.
c clascl LAPACK routine for careful scaling of a matrix.
c slabad LAPACK routine for defining the underflow and overflow
c limits
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c cgemv Level 2 BLAS routine for matrix vector multiplication.
c caxpy Level 1 BLAS that computes a vector triad.
@@ -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
@@ -308,8 +309,8 @@ c
Complex
& cdotc
Real
& pslamch, pscnorm2, clanhs, slapy2
external cdotc, pscnorm2, clanhs, pslamch, slapy2
& pslamch10, pscnorm2, clanhs, slapy2
external cdotc, pscnorm2, clanhs, pslamch10, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -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 |
@@ -337,12 +337,12 @@ c | overflow should not occur. |
c | REFERENCE: LAPACK subroutine clahqr |
c %-----------------------------------------%
c
unfl = pslamch(comm, 'safe minimum' )
unfl = pslamch10(comm, 'safe minimum' )
ovfl = real(one / unfl)
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
ulp = pslamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
+10 -11
View File
@@ -105,7 +105,7 @@ c clartg LAPACK Givens rotation construction routine.
c claset LAPACK matrix initialization routine.
c slabad LAPACK routine for defining the underflow and overflow
c limits.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c cgemv Level 2 BLAS routine for matrix vector multiplication.
c caxpy Level 1 BLAS that computes a vector triad.
@@ -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 |
@@ -207,8 +207,8 @@ c | External Functions |
c %--------------------%
c
Real
& clanhs, pslamch, slapy2
external clanhs, pslamch, slapy2
& clanhs, pslamch10, slapy2
external clanhs, pslamch10, slapy2
c
c %----------------------%
c | Intrinsics Functions |
@@ -225,16 +225,15 @@ c
cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
c
c %----------------%
c | Data statments |
c | Data statements |
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 |
@@ -243,12 +242,12 @@ c | overflow should not occur. |
c | REFERENCE: LAPACK subroutine clahqr |
c %-----------------------------------------------%
c
unfl = pslamch( comm, 'safe minimum' )
unfl = pslamch10( comm, 'safe minimum' )
ovfl = real(one / unfl)
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
ulp = pslamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
+5 -5
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Hessenberg matrix has split off and contains "unwanted"
c Ritz values.
@@ -141,7 +141,7 @@ c arscnd ARPACK utility routine for timing.
c pcmout Parallel ARPACK utility routine that prints matrices
c pcvout Parallel ARPACK utility routine that prints vectors.
c psvout ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c ccopy Level 1 BLAS that copies one vector to another .
c cdotc Level 1 BLAS that computes the scalar product of two vectors.
@@ -259,8 +259,8 @@ c
Complex
& cdotc
Real
& pscnorm2, pslamch, slapy2
external cdotc, pscnorm2, pslamch, slapy2
& pscnorm2, pslamch10, slapy2
external cdotc, pscnorm2, pslamch10, slapy2
c
c %---------------------%
c | Intrinsic Functions |
@@ -298,7 +298,7 @@ c %---------------------------------%
c | Get machine dependent constant. |
c %---------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0 / 3.0)
c
c %---------------------------------------%
+16 -8
View File
@@ -108,8 +108,8 @@ c TOL Real scalar. (INPUT)
c Stopping criteria: the relative accuracy of the Ritz value
c is considered acceptable if BOUNDS(I) .LE. TOL*ABS(RITZ(I))
c where ABS(RITZ(I)) is the magnitude when RITZ(I) is complex.
c DEFAULT = pslamch(comm, 'EPS') (machine precision as computed
c by the ScaLAPACK auxiliary subroutine pslamch).
c DEFAULT = pslamch10(comm, 'EPS') (machine precision as computed
c by the ScaLAPACK auxiliary subroutine pslamch10).
c
c RESID Complex array of length N. (INPUT/OUTPUT)
c On INPUT:
@@ -258,7 +258,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c User input error highly likely. Please
@@ -360,7 +360,7 @@ c cstatn ARPACK routine that initializes the timing variables.
c pivout Parallel ARPACK utility routine that prints integers.
c pcvout Parallel ARPACK utility routine that prints vectors.
c arscnd ARPACK utility routine for timing.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c
c\Author
c Danny Sorensen Phuong Vu
@@ -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,21 +447,28 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pcnaup2, pcvout, pivout, arscnd, cstatn
external pcnaup2, pcvout, pivout, arscnd, cstatn, pcontext
c
c %--------------------%
c | External Functions |
c %--------------------%
c
Real
& pslamch
external pslamch
& pslamch10
external pslamch10
c
c %-----------------------%
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 |
@@ -529,7 +537,7 @@ c | Set default parameters |
c %------------------------%
c
if (nb .le. 0) nb = 1
if (tol .le. 0.0 ) tol = pslamch(comm, 'EpsMach')
if (tol .le. 0.0 ) tol = pslamch10(comm, 'EpsMach')
if (ishift .ne. 0 .and.
& ishift .ne. 1 .and.
& ishift .ne. 2) ishift = 1
+4 -4
View File
@@ -213,7 +213,7 @@ c in upper triangular form.
c ctrsen LAPACK routine that re-orders the Schur form.
c cunm2r LAPACK routine that applies an orthogonal matrix in
c factored form.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c ctrmm Level 3 BLAS matrix times an upper triangular matrix.
c cgeru Level 2 BLAS rank one update to a matrix.
c ccopy Level 1 BLAS that copies one vector to another .
@@ -336,8 +336,8 @@ c | External Functions |
c %--------------------%
c
Real
& scnrm2,pslamch,slapy2
external scnrm2,pslamch,slapy2
& scnrm2,pslamch10,slapy2
external scnrm2,pslamch10,slapy2
c
Complex
& cdotc
@@ -367,7 +367,7 @@ c %---------------------------------%
c | Get machine dependent constant. |
c %---------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0 / 3.0)
c
c %-------------------------------%
+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
+4 -4
View File
@@ -1,12 +1,12 @@
DOUBLE PRECISION FUNCTION PDLAMCH10( ICTXT, CMACH )
include "mpif.h"
*
* -- ScaLAPACK auxilliary routine (version 1.0) --
* -- ScaLAPACK auxiliary routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* 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
+3 -3
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 |
@@ -401,7 +401,7 @@ c
c
c %---------------------------------------------------%
c | STEP 1: Check if the B norm of j-th residual |
c | vector is zero. Equivalent to determing whether |
c | vector is zero. Equivalent to determining whether |
c | an exact j-step Arnoldi factorization is present. |
c %---------------------------------------------------%
c
+8 -8
View File
@@ -34,7 +34,7 @@ c
c KEV Integer. (INPUT/OUTPUT)
c KEV+NP is the size of the input matrix H.
c KEV is the size of the updated matrix HNEW. KEV is only
c updated on ouput when fewer than NP shifts are applied in
c updated on output when fewer than NP shifts are applied in
c order to keep the conjugate pair together.
c
c NP Integer. (INPUT)
@@ -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 |
@@ -215,16 +216,15 @@ c
intrinsic abs, max, min
c
c %----------------%
c | Data statments |
c | Data statements |
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 %-------------------------------%
@@ -395,7 +395,7 @@ c
do 80 i = istart, iend-1
c
c %-----------------------------------------------------%
c | Contruct the plane rotation G to zero out the bulge |
c | Construct the plane rotation G to zero out the bulge |
c %-----------------------------------------------------%
c
call dlartg (f, g, c, s, r)
+2 -2
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV for two reasons. The first, is
c to keep complex conjugate pairs of "wanted" Ritz values
c together. The second, is that a leading block of the current
@@ -718,7 +718,7 @@ c
if (ishift .eq. 0) then
c
c %-------------------------------------------------------%
c | User specified shifts: reverse comminucation to |
c | User specified shifts: reverse communication to |
c | compute the shifts. They are returned in the first |
c | 2*NP locations of WORKL. |
c %-------------------------------------------------------%
+10 -2
View File
@@ -276,7 +276,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
@@ -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 |
+6 -6
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 |
@@ -399,8 +399,8 @@ c
end if
c
c %---------------------------------------------------------%
c | Check for exact zero. Equivalent to determing whether a |
c | j-step Arnoldi factorization is present. |
c | Check for exact zero. Equivalent to determining whether |
c | a j-step Arnoldi factorization is present. |
c %---------------------------------------------------------%
c
if (rnorm .gt. zero) go to 40
+6 -6
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
@@ -204,18 +205,17 @@ c
intrinsic abs
c
c %----------------%
c | Data statments |
c | Data statements |
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
+1 -1
View File
@@ -29,7 +29,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Tridiagonal matrix has split off and contains "unwanted"
c Ritz values.
+12 -4
View File
@@ -271,9 +271,9 @@ c = -8: Error return from trid. eigenvalue calculation;
c Informatinal error from LAPACK routine dsteqr .
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4,5.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -13: NEV and WHICH = 'BE' are incompatable.
c = -13: NEV and WHICH = 'BE' are incompatible.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
c factorization. The user is advised to check that
@@ -310,7 +310,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
@@ -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 %-------------------------------%
@@ -1,7 +1,7 @@
REAL FUNCTION PSLAMCH( ICTXT, CMACH )
REAL FUNCTION PSLAMCH10( ICTXT, CMACH )
*
include "mpif.h"
* -- ScaLAPACK auxilliary routine (version 1.0) --
* -- ScaLAPACK auxiliary routine (version 1.0) --
* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
* and University of California, Berkeley.
* February 28, 1995
@@ -82,8 +82,8 @@
TEMP = TEMP1
END IF
*
PSLAMCH = TEMP
PSLAMCH10 = TEMP
*
* End of PSLAMCH
* End of PSLAMCH10
*
END
+11 -11
View File
@@ -142,7 +142,7 @@ c arscnd ARPACK utility routine for timing.
c psmout Parallel ARPACK utility routine that prints matrices
c psvout Parallel ARPACK utility routine that prints vectors.
c slabad LAPACK routine that computes machine constants.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slascl LAPACK routine for careful scaling of a matrix.
c slanhs LAPACK routine that computes various norms of a matrix.
c sgemv Level 2 BLAS routine for matrix vector multiplication.
@@ -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
@@ -297,8 +298,8 @@ c | External Functions |
c %--------------------%
c
Real
& sdot, psnorm2, slanhs, pslamch
external sdot, psnorm2, slanhs, pslamch
& sdot, psnorm2, slanhs, pslamch10
external sdot, psnorm2, slanhs, pslamch10
c
c %---------------------%
c | Intrinsic Functions |
@@ -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 |
@@ -326,12 +326,12 @@ c | overflow should not occur. |
c | REFERENCE: LAPACK subroutine slahqr |
c %-----------------------------------------%
c
unfl = pslamch(comm, 'safe minimum' )
unfl = pslamch10(comm, 'safe minimum' )
ovfl = one / unfl
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
ulp = pslamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
aitr_first = .false.
end if
c
if (ido .eq. 0) then
@@ -401,7 +401,7 @@ c
c
c %---------------------------------------------------%
c | STEP 1: Check if the B norm of j-th residual |
c | vector is zero. Equivalent to determing whether |
c | vector is zero. Equivalent to determining whether |
c | an exact j-step Arnoldi factorization is present. |
c %---------------------------------------------------%
c
+13 -13
View File
@@ -34,7 +34,7 @@ c
c KEV Integer. (INPUT/OUTPUT)
c KEV+NP is the size of the input matrix H.
c KEV is the size of the updated matrix HNEW. KEV is only
c updated on ouput when fewer than NP shifts are applied in
c updated on output when fewer than NP shifts are applied in
c order to keep the conjugate pair together.
c
c NP Integer. (INPUT)
@@ -102,7 +102,7 @@ c
c\Routines called:
c slabad LAPACK routine that computes machine constants.
c slacpy LAPACK matrix copy routine.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slanhs LAPACK routine that computes various norms of a matrix.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c slarf LAPACK routine that applies Householder reflection to
@@ -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 |
@@ -205,8 +206,8 @@ c | External Functions |
c %--------------------%
c
Real
& pslamch, slanhs, slapy2
external pslamch, slanhs, slapy2
& pslamch10, slanhs, slapy2
external pslamch10, slanhs, slapy2
c
c %----------------------%
c | Intrinsics Functions |
@@ -215,16 +216,15 @@ c
intrinsic abs, max, min
c
c %----------------%
c | Data statments |
c | Data statements |
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 |
@@ -233,12 +233,12 @@ c | overflow should not occur. |
c | REFERENCE: LAPACK subroutine slahqr |
c %-----------------------------------------------%
c
unfl = pslamch( comm, 'safe minimum' )
unfl = pslamch10( comm, 'safe minimum' )
ovfl = one / unfl
call slabad( unfl, ovfl )
ulp = pslamch( comm, 'precision' )
ulp = pslamch10( comm, 'precision' )
smlnum = unfl*( n / ulp )
first = .false.
apps_first = .false.
end if
c
c %-------------------------------%
@@ -395,7 +395,7 @@ c
do 80 i = istart, iend-1
c
c %-----------------------------------------------------%
c | Contruct the plane rotation G to zero out the bulge |
c | Construct the plane rotation G to zero out the bulge |
c %-----------------------------------------------------%
c
call slartg (f, g, c, s, r)
+6 -6
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV for two reasons. The first, is
c to keep complex conjugate pairs of "wanted" Ritz values
c together. The second, is that a leading block of the current
@@ -148,7 +148,7 @@ c pivout Parallel ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c psmout Parallel ARPACK utility routine that prints matrices
c psvout ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c scopy Level 1 BLAS that copies one vector to another .
c sdot Level 1 BLAS that computes the scalar product of two vectors.
@@ -262,8 +262,8 @@ c | External Functions |
c %--------------------%
c
Real
& sdot, psnorm2, slapy2, pslamch
external sdot, psnorm2, slapy2, pslamch
& sdot, psnorm2, slapy2, pslamch10
external sdot, psnorm2, slapy2, pslamch10
c
c %---------------------%
c | Intrinsic Functions |
@@ -285,7 +285,7 @@ c %-------------------------------------%
c | Get the machine dependent constant. |
c %-------------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0 / 3.0 )
c
nev0 = nev
@@ -718,7 +718,7 @@ c
if (ishift .eq. 0) then
c
c %-------------------------------------------------------%
c | User specified shifts: reverse comminucation to |
c | User specified shifts: reverse communication to |
c | compute the shifts. They are returned in the first |
c | 2*NP locations of WORKL. |
c %-------------------------------------------------------%
+14 -6
View File
@@ -276,7 +276,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
@@ -384,7 +384,7 @@ c Arnoldi Iteration.
c pivout Parallel ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c psvout Parallel ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c
c\Author
c Danny Sorensen Phuong Vu
@@ -414,6 +414,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -468,21 +469,28 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external psnaup2, psvout, pivout, arscnd, sstatn
external psnaup2, psvout, pivout, arscnd, sstatn, pcontext
c
c %--------------------%
c | External Functions |
c %--------------------%
c
Real
& pslamch
external pslamch
& pslamch10
external pslamch10
c
c %-----------------------%
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 |
@@ -553,7 +561,7 @@ c | Set default parameters |
c %------------------------%
c
if (nb .le. 0) nb = 1
if (tol .le. zero) tol = pslamch(comm, 'EpsMach')
if (tol .le. zero) tol = pslamch10(comm, 'EpsMach')
c
c %----------------------------------------------%
c | NP is the number of additional steps to |
+4 -4
View File
@@ -238,7 +238,7 @@ c a matrix.
c slacpy LAPACK matrix copy routine.
c slahqr LAPACK routine to compute the real Schur form of an
c upper Hessenberg matrix.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
c slaset LAPACK matrix initialization routine.
c sorm2r LAPACK routine that applies an orthogonal matrix in
@@ -388,8 +388,8 @@ c | External Functions |
c %--------------------%
c
Real
& slapy2, snrm2, pslamch
external slapy2, snrm2, pslamch
& slapy2, snrm2, pslamch10
external slapy2, snrm2, pslamch10
c
c %---------------------%
c | Intrinsic Functions |
@@ -414,7 +414,7 @@ c %---------------------------------%
c | Get machine dependent constant. |
c %---------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0 / 3.0 )
c
c %--------------%
+9 -9
View File
@@ -139,7 +139,7 @@ c psgetv0 Parallel ARPACK routine to generate the initial vector.
c pivout Parallel ARPACK utility routine that prints integers.
c psmout Parallel ARPACK utility routine that prints matrices.
c psvout Parallel ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slascl LAPACK routine for careful scaling of a matrix.
c sgemv Level 2 BLAS routine for matrix vector multiplication.
c saxpy Level 1 BLAS that computes a vector triad.
@@ -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
@@ -290,14 +291,13 @@ c | External Functions |
c %--------------------%
c
Real
& sdot, psnorm2, pslamch
external sdot, psnorm2, pslamch
& sdot, psnorm2, pslamch10
external sdot, psnorm2, pslamch10
c
c %-----------------%
c | Data statements |
c %-----------------%
c
data first / .true. /
c
c
c %---------------------%
@@ -310,15 +310,15 @@ 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 |
c | that 1/sfmin does not overflow |
c %--------------------------------%
c
safmin = pslamch(comm,'safmin')
safmin = pslamch10(comm,'safmin')
end if
c
if (ido .eq. 0) then
@@ -399,7 +399,7 @@ c
end if
c
c %---------------------------------------------------------%
c | Check for exact zero. Equivalent to determing whether a |
c | Check for exact zero. Equivalent to determining whether a |
c | j-step Arnoldi factorization is present. |
c %---------------------------------------------------------%
c
+10 -11
View File
@@ -95,7 +95,7 @@ c\Routines called:
c pivout Parallel ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c psvout Parallel ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c slartg LAPACK Givens rotation construction routine.
c slacpy LAPACK matrix copy routine.
c slaset LAPACK matrix initialization routine.
@@ -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 %----------------------%
@@ -194,8 +194,8 @@ c | External Functions |
c %--------------------%
c
Real
& pslamch
external pslamch
& pslamch10
external pslamch10
c
c %----------------------%
c | Intrinsics Functions |
@@ -204,18 +204,17 @@ c
intrinsic abs
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
c
c %-----------------------%
c | Executable Statements |
c %-----------------------%
c
if (first) then
epsmch = pslamch(comm, 'Epsilon-Machine')
first = .false.
if (apps_first) then
epsmch = pslamch10(comm, 'Epsilon-Machine')
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
+5 -5
View File
@@ -29,7 +29,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Tridiagonal matrix has split off and contains "unwanted"
c Ritz values.
@@ -155,7 +155,7 @@ c tridiagonal matrix using the implicit QL or QR method.
c pivout Parallel ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c psvout Parallel ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c scopy Level 1 BLAS that copies one vector to another.
c sdot Level 1 BLAS that computes the scalar product of two vectors.
c psnorm2 Parallel version of Level 1 BLAS that computes the norm of a vector.
@@ -263,8 +263,8 @@ c | External Functions |
c %--------------------%
c
Real
& sdot, psnorm2, pslamch
external sdot, psnorm2, pslamch
& sdot, psnorm2, pslamch10
external sdot, psnorm2, pslamch10
c
c %---------------------%
c | Intrinsic Functions |
@@ -290,7 +290,7 @@ c %---------------------------------%
c | Set machine dependent constant. |
c %---------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0/3.0)
c
c %-------------------------------------%
+16 -8
View File
@@ -271,9 +271,9 @@ c = -8: Error return from trid. eigenvalue calculation;
c Informatinal error from LAPACK routine ssteqr.
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3,4,5.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -13: NEV and WHICH = 'BE' are incompatable.
c = -13: NEV and WHICH = 'BE' are incompatible.
c = -9999: Could not build an Arnoldi factorization.
c IPARAM(5) returns the size of the current Arnoldi
c factorization. The user is advised to check that
@@ -310,7 +310,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
@@ -386,7 +386,7 @@ c variables.
c pivout Parallel ARPACK utility routine that prints integers.
c arscnd ARPACK utility routine for timing.
c psvout Parallel ARPACK utility routine that prints vectors.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c
c\Authors
c Kristi Maschhoff ( Parallel Code )
@@ -418,6 +418,7 @@ c
& iparam, ipntr, workd, workl, lworkl, info )
c
include 'mpif.h'
include 'pcontext.h'
c
c %------------------%
c | MPI Variables |
@@ -472,15 +473,15 @@ c %----------------------%
c | External Subroutines |
c %----------------------%
c
external pssaup2, psvout, pivout, arscnd, sstats
external pssaup2, psvout, pivout, arscnd, sstats, pcontext
c
c %--------------------%
c | External Functions |
c %--------------------%
c
Real
& pslamch
external pslamch
& pslamch10
external pslamch10
c
c %-----------------------%
c | Executable Statements |
@@ -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 %-------------------------------%
@@ -563,7 +571,7 @@ c | Set default parameters |
c %------------------------%
c
if (nb .le. 0) nb = 1
if (tol .le. zero) tol = pslamch(comm, 'EpsMach')
if (tol .le. zero) tol = pslamch10(comm, 'EpsMach')
c
c %----------------------------------------------%
c | NP is the number of additional steps to |
+4 -4
View File
@@ -191,7 +191,7 @@ c psvout Parallel ARPACK utility routine that prints vectors.
c sgeqr2 LAPACK routine that computes the QR factorization of
c a matrix.
c slacpy LAPACK matrix copy routine.
c pslamch ScaLAPACK routine that determines machine constants.
c pslamch10 ScaLAPACK routine that determines machine constants.
c sorm2r LAPACK routine that applies an orthogonal matrix in
c factored form.
c ssteqr LAPACK routine that computes eigenvalues and eigenvectors
@@ -295,8 +295,8 @@ c | External Functions |
c %--------------------%
c
Real
& psnorm2, pslamch
external psnorm2, pslamch
& psnorm2, pslamch10
external psnorm2, pslamch10
c
c %---------------------%
c | Intrinsic Functions |
@@ -439,7 +439,7 @@ c %---------------------------------%
c | Set machine dependent constant. |
c %---------------------------------%
c
eps23 = pslamch(comm, 'Epsilon-Machine')
eps23 = pslamch10(comm, 'Epsilon-Machine')
eps23 = eps23**(2.0 / 3.0)
c
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
+5 -6
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 |
@@ -225,16 +225,15 @@ c
cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
c
c %----------------%
c | Data statments |
c | Data statements |
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 %-------------------------------%
+1 -1
View File
@@ -28,7 +28,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Hessenberg matrix has split off and contains "unwanted"
c Ritz values.
+10 -2
View File
@@ -258,7 +258,7 @@ c = -7: Length of private work array is not sufficient.
c = -8: Error return from LAPACK eigenvalue calculation;
c = -9: Starting vector is zero.
c = -10: IPARAM(7) must be 1,2,3.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatable.
c = -11: IPARAM(7) = 1 and BMAT = 'G' are incompatible.
c = -12: IPARAM(1) must be equal to 0 or 1.
c = -9999: Could not build an Arnoldi factorization.
c User input error highly likely. Please
@@ -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
+30
View File
@@ -0,0 +1,30 @@
F77 = $(MPIF77)
LDADD = $(top_builddir)/PARPACK/SRC/MPI/libparpack$(LIBSUFFIX).la $(LAPACK_LIBS) $(BLAS_LIBS)
# Run MPI tests with "mpirun -n 2"
LOG_COMPILER = mpirun
LOG_FLAGS = -n 2
SISS = issue46
check_PROGRAMS = $(SISS)
if ICB
check_PROGRAMS += icb_parpack_c
check_PROGRAMS += icb_parpack_cpp
endif
EXTRA_DIST = debug.h stat.h
issue46_SOURCES= issue46.f
if ICB
icb_parpack_c_SOURCES = icb_parpack_c.c
icb_parpack_c_LDADD = $(LDADD) $(MPI_C_LIBS)
icb_parpack_c_CFLAGS = -I$(top_builddir)
icb_parpack_cpp_SOURCES = icb_parpack_cpp.cpp
icb_parpack_cpp_LDADD = $(LDADD) $(MPI_CXX_LIBS)
icb_parpack_cpp_CPPFLAGS = -I$(top_builddir)
endif
TESTS = $(check_PROGRAMS)
+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
+202
View File
@@ -0,0 +1,202 @@
/*
* This example demonstrates the use of ISO_C_BINDING to call arpack (portability).
* IMPORTANT: MPI communicators MUST be passed from C to Fortran using MPI_Comm_c2f.
*
* Just use arpack as you would have normally done, but, use *[ae]upd_c instead of *[ae]upd_.
* The main advantage is that compiler checks (arguments) are performed at build time.
* Note: to debug parpack, call debug_c.
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h> // bool.
#include "mpi.h"
#include "parpack.h"
#include <complex.h> // creal, cimag.
#include "debug_c.h" // debug parpack.
#include "stat_c.h" // arpack statistics.
/* 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.
* */
#ifndef BLASINT
#define BLASINT int
#endif
void dMatVec(double * x, double * y) {
int i;
for ( i = 0; i < 1000; ++i)
y[i] = ((double) (i+1))*x[i];
};
int ds() {
BLASINT ido = 0;
char bmat[] = "I";
BLASINT N = 1000;
char which[] = "LM";
BLASINT nev = 3;
double tol = 0;
double resid[N];
BLASINT ncv = 2*nev+1;
double V[ncv*N];
BLASINT ldv = N;
BLASINT iparam[11];
BLASINT ipntr[14];
double workd[3*N];
bool rvec = true;
char howmny[] = "A";
double* d = (double*) malloc((nev+1)*sizeof(double));
int select[ncv];
double z[(N+1)*(nev+1)];
BLASINT ldz = N+1;
double sigma=0;
int k;
for (k=0; k < 3*N; ++k )
workd[k] = 0;
double workl[3*(ncv*ncv) + 6*ncv];
for (k=0; k < 3*(ncv*ncv) + 6*ncv; ++k )
workl[k] = 0;
BLASINT lworkl = 3*(ncv*ncv) + 6*ncv;
BLASINT info = 0;
int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);
iparam[0] = 1;
iparam[2] = 10*N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
while(ido != 99) {
/* call arpack like you would have, but, use dsaupd_c instead of dsaupd_ */
pdsaupd_c(MCW, &ido, bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam, ipntr,
workd, workl, lworkl, &info);
dMatVec(&(workd[ipntr[0]-1]), &(workd[ipntr[1]-1]));
}
if (iparam[4] != nev) return 1; // check number of ev found by arpack.
/* call arpack like you would have, but, use dseupd_c instead of dseupd_ */
pdseupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma,
bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam, ipntr,
workd, workl, lworkl, &info);
int i;
for (i = 0; i < nev; ++i) {
printf("rank %d - %f\n", rank, d[i]);
if(fabs(d[i] - (double)(1000-(nev-1)+i))>1e-6){
free(d);
return 1;
}
}
free(d);
return 0;
}
void zMatVec(double _Complex * x, double _Complex * y) {
int i;
for (i = 0; i < 1000; ++i)
y[i] = x[i] * (i+1.0 + _Complex_I * (i+1.0));
};
int zn() {
BLASINT ido = 0;
char bmat[] = "I";
BLASINT N = 1000;
char which[] = "LM";
BLASINT nev = 1;
double tol = 0;
double _Complex resid[N];
BLASINT ncv = 2*nev+1;
double _Complex V[ncv*N];
BLASINT ldv = N;
BLASINT iparam[11];
BLASINT ipntr[14];
double _Complex workd[3*N];
bool rvec = true;
char howmny[] = "A";
double _Complex* d = (double _Complex*) malloc((nev+1)*sizeof(double _Complex));
int select[ncv];
double _Complex z[(N+1)*(nev+1)];
BLASINT ldz = N+1;
double sigma=0;
int k;
for (k=0; k < 3*N; ++k )
workd[k] = 0. + I * 0.;
double _Complex workl[3*(ncv*ncv) + 6*ncv];
for (k=0; k < 3*(ncv*ncv) + 6*ncv; ++k )
workl[k] = 0. + I * 0.;
BLASINT lworkl = 3*(ncv*ncv) + 6*ncv;
double _Complex rwork[ncv];
double _Complex workev[2*ncv];
BLASINT info = 0;
int rank; MPI_Comm_rank(MPI_COMM_WORLD, &rank);
iparam[0] = 1;
iparam[2] = 10*N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
while(ido != 99) {
/* call arpack like you would have, but, use znaupd_c instead of znaupd_ */
pznaupd_c(MCW, &ido, bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam, ipntr,
workd, workl, lworkl, rwork, &info);
zMatVec(&(workd[ipntr[0]-1]), &(workd[ipntr[1]-1]));
}
if (iparam[4] != nev) return 1; // check number of ev found by arpack.
/* call arpack like you would have, but, use zneupd_c instead of zneupd_ */
pzneupd_c(MCW, rvec, howmny, select, d, z, ldz, sigma, workev,
bmat, N, which, nev, tol, resid, ncv, V, ldv, iparam, ipntr,
workd, workl, lworkl, rwork, &info);
int i;
for (i = 0; i < nev; ++i) {
printf("rank %d - %f %f\n", rank, creal(d[i]), cimag(d[i]));
if(fabs(creal(d[i]) - (double)(1000-i))>1e-6 || fabs(cimag(d[i]) - (double)(1000-i))>1e-6){
free(d);
return 1;
}
}
free(d);
return 0;
}
int main() {
MPI_Init(NULL, NULL);
sstats_c();
int rc = ds(); // parpack without debug.
fflush(stdout);
MPI_Barrier(MPI_COMM_WORLD);
if (rc != 0) return rc;
int nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c;
float tsaupd_c, tsaup2_c, tsaitr_c, tseigt_c, tsgets_c, tsapps_c, tsconv_c;
float tnaupd_c, tnaup2_c, tnaitr_c, tneigt_c, tngets_c, tnapps_c, tnconv_c;
float tcaupd_c, tcaup2_c, tcaitr_c, tceigt_c, tcgets_c, tcapps_c, tcconv_c;
float tmvopx_c, tmvbx_c, tgetv0_c, titref_c, trvec_c;
stat_c( &nopx_c, &nbx_c, &nrorth_c, &nitref_c, &nrstrt_c,
&tsaupd_c, &tsaup2_c, &tsaitr_c, &tseigt_c, &tsgets_c, &tsapps_c, &tsconv_c,
&tnaupd_c, &tnaup2_c, &tnaitr_c, &tneigt_c, &tngets_c, &tnapps_c, &tnconv_c,
&tcaupd_c, &tcaup2_c, &tcaitr_c, &tceigt_c, &tcgets_c, &tcapps_c, &tcconv_c,
&tmvopx_c, &tmvbx_c, &tgetv0_c, &titref_c, &trvec_c);
printf("Timers : nopx %d, tmvopx %f - nbx %d, tmvbx %f\n", nopx_c, tmvopx_c, nbx_c, tmvbx_c);
int rank = 0; MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0) printf("------\n");
debug_c(6, -6, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1); // set debug flags.
rc = zn(); // parpack with debug.
fflush(stdout);
MPI_Barrier(MPI_COMM_WORLD);
if (rc != 0) return rc;
MPI_Finalize();
return 0;
}
+231
View File
@@ -0,0 +1,231 @@
/*
* This example demonstrates the use of ISO_C_BINDING to call parpack
* (portability). IMPORTANT: MPI communicators MUST be passed from C to Fortran
* using MPI_Comm_c2f.
*
* Just use arpack as you would have normally done but use [ae]upd instead
* of *[ae]upd_. The main advantage is that checks of the arguments are
* performed at compile time. Note: to debug parpack, call debug_c.
* This test program solves 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.
*/
#include "parpack.hpp"
#include <array>
#include <cmath>
#include <iostream>
#include <vector>
#include "debug_c.hpp" // debug parpack.
#include "stat_c.hpp" // arpack statistics.
#ifndef BLASINT
#define BLASINT int
#endif
void diagonal_matrix_vector_product(float const* const x, float* const y) {
for (int i = 0; i < 1000; ++i) {
y[i] = static_cast<float>(i + 1) * x[i];
}
}
void real_symmetric_runner() {
BLASINT N = 1000;
BLASINT nev = 3;
BLASINT ncv = 2 * nev + 1;
BLASINT ldz = N + 1;
BLASINT lworkl = 3 * (ncv * ncv) + 6 * ncv;
BLASINT ldv = N;
bool rvec = true;
float tol = 0.0f;
float sigma = 0.0f;
std::array<BLASINT, 14> ipntr;
std::vector<float> workd(3 * N, 0.0f);
std::vector<float> workl(3 * (ncv * ncv) + 6 * ncv, 0.0f);
std::vector<float> V(ncv * N);
std::vector<float> d(nev + 1);
std::vector<float> z((N + 1) * (nev + 1));
std::vector<float> resid(N);
std::vector<int> select(ncv);
BLASINT info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
std::array<BLASINT, 11> iparam;
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
BLASINT ido = 0;
while (ido != 99) {
arpack::saupd(MCW, ido, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
workl.data(), lworkl, info);
diagonal_matrix_vector_product(&(workd[ipntr[0] - 1]),
&(workd[ipntr[1] - 1]));
}
// check number of ev found by arpack.
if (iparam[4] != nev || info != 0) {
throw std::domain_error("Error inside ARPACK routines");
}
arpack::seupd(MCW, rvec, arpack::howmny::ritz_vectors, select.data(),
d.data(), z.data(), ldz, sigma, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
workl.data(), lworkl, info);
for (int i = 0; i < nev; ++i) {
std::cout << "rank " << rank << " - " << d[i] << std::endl;
if (std::abs(d[i] - static_cast<float>(1000 - (nev - 1) + i)) > 1e-1) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
}
void diagonal_matrix_vector_product(std::complex<float> const* const x,
std::complex<float>* const y) {
for (int i = 0; i < 1000; ++i) {
y[i] = x[i] * std::complex<float>{i + 1.0f, i + 1.0f};
}
}
void complex_symmetric_runner() {
BLASINT N = 1000;
BLASINT nev = 1;
BLASINT ncv = 2 * nev + 1;
BLASINT ldv = N;
BLASINT ldz = N + 1;
float tol = 0.0f;
bool rvec = true;
float sigma = 0.0f;
std::vector<std::complex<float>> resid(N);
std::vector<std::complex<float>> V(ncv * N);
std::vector<std::complex<float>> workd(3 * N);
std::vector<std::complex<float>> d(nev + 1);
std::vector<std::complex<float>> z((N + 1) * (nev + 1));
std::vector<int> select(ncv);
BLASINT lworkl = 3 * (ncv * ncv) + 6 * ncv;
std::vector<std::complex<float>> workl(lworkl);
std::vector<std::complex<float>> rwork(ncv);
std::vector<std::complex<float>> workev(2 * ncv);
BLASINT info = 0;
int rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
std::array<BLASINT, 11> iparam;
iparam[0] = 1;
iparam[2] = 10 * N;
iparam[3] = 1;
iparam[4] = 0; // number of ev found by arpack.
iparam[6] = 1;
std::array<BLASINT, 14> ipntr;
MPI_Fint MCW = MPI_Comm_c2f(MPI_COMM_WORLD);
BLASINT ido = 0;
while (ido != 99) {
arpack::naupd(MCW, ido, arpack::bmat::identity, N,
arpack::which::largest_magnitude, nev, tol, resid.data(), ncv,
V.data(), ldv, iparam.data(), ipntr.data(), workd.data(),
workl.data(), lworkl, rwork.data(), info);
diagonal_matrix_vector_product(&(workd[ipntr[0] - 1]),
&(workd[ipntr[1] - 1]));
}
// check number of ev found by arpack
if (iparam[4] != nev || info != 0) {
throw std::domain_error("Error inside ARPACK routines");
}
arpack::neupd(MCW, rvec, arpack::howmny::ritz_vectors, select.data(),
d.data(), z.data(), ldz, sigma, workev.data(),
arpack::bmat::identity, N, arpack::which::largest_magnitude,
nev, tol, resid.data(), ncv, V.data(), ldv, iparam.data(),
ipntr.data(), workd.data(), workl.data(), lworkl, rwork.data(),
info);
for (int i = 0; i < nev; ++i) {
std::cout << "rank " << rank << " - " << std::real(d[i]) << " "
<< std::imag(d[i]) << '\n';
if (std::abs(std::real(d[i]) - static_cast<float>(1000 - i)) > 1e-1 ||
std::abs(std::imag(d[i]) - static_cast<float>(1000 - i)) > 1e-1) {
throw std::domain_error("Correct eigenvalues not computed");
}
}
}
int main() {
MPI_Init(NULL, NULL);
sstats_c();
try {
// parpack without debug
real_symmetric_runner();
} catch (std::domain_error& e) {
std::cout << e.what() << '\n';
MPI_Abort(MPI_COMM_WORLD, 1);
}
MPI_Barrier(MPI_COMM_WORLD);
int nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c;
float tsaupd_c, tsaup2_c, tsaitr_c, tseigt_c, tsgets_c, tsapps_c, tsconv_c;
float tnaupd_c, tnaup2_c, tnaitr_c, tneigt_c, tngets_c, tnapps_c, tnconv_c;
float tcaupd_c, tcaup2_c, tcaitr_c, tceigt_c, tcgets_c, tcapps_c, tcconv_c;
float tmvopx_c, tmvbx_c, tgetv0_c, titref_c, trvec_c;
stat_c(nopx_c, nbx_c, nrorth_c, nitref_c, nrstrt_c, tsaupd_c, tsaup2_c,
tsaitr_c, tseigt_c, tsgets_c, tsapps_c, tsconv_c, tnaupd_c, tnaup2_c,
tnaitr_c, tneigt_c, tngets_c, tnapps_c, tnconv_c, tcaupd_c, tcaup2_c,
tcaitr_c, tceigt_c, tcgets_c, tcapps_c, tcconv_c, tmvopx_c, tmvbx_c,
tgetv0_c, titref_c, trvec_c);
std::cout << "Timers : nopx " << nopx_c << ", tmvopx " << tmvopx_c;
std::cout << " - nbx " << nbx_c << ", tmvbx " << tmvbx_c << std::endl;
int rank = 0;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
if (rank == 0) std::cout << "------" << std::endl;
// set debug flags.
debug_c(6, -6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1);
try {
complex_symmetric_runner();
} catch (std::domain_error& e) {
std::cout << e.what() << '\n';
MPI_Abort(MPI_COMM_WORLD, 1);
}
MPI_Barrier(MPI_COMM_WORLD);
MPI_Finalize();
return 0;
}
+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
+8 -4
View File
@@ -122,7 +122,7 @@ c SELECT Logical array of dimension NCV. (INPUT/WORKSPACE)
9. 06/04/98:
p[s,d,c,z]larnv.f The integer arguement IDIST is not declared.
p[s,d,c,z]larnv.f The integer argument IDIST is not declared.
10. 06/04/98:
In p[s,d]neupd.f, the declaration of p[s,d]norm2 is missing.
@@ -185,7 +185,7 @@ c SELECT Logical array of dimension NCV. (INPUT/WORKSPACE)
18. 08/08/2000
In _saitr.f and _naitr.f, add a check for NP = 0 at the very begining of
In _saitr.f and _naitr.f, add a check for NP = 0 at the very beginning of
this routine
19. 09/21/2000
@@ -279,7 +279,7 @@ c SELECT Logical array of dimension NCV. (INPUT/WORKSPACE)
26. 04/10/2001
In all _seupd codes (both serial and parallel) the call to
_sgets had an extra arguement:
_sgets had an extra argument:
call dsgets (ishift, which , nev ,
& np , workl(irz) , workl(bounds),
@@ -327,7 +327,11 @@ c SELECT Logical array of dimension NCV. (INPUT/WORKSPACE)
33. 10/24/2003 replace 'slamch' with 'pslamch' in p[c,z]napps.f
34. 10/24/2003 removed an extra arguement to the p[s,d]sgets() call.
34. 10/24/2003 removed an extra argument to the p[s,d]sgets() call.
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 reset each first iteration
+64 -28
View File
@@ -1,6 +1,9 @@
ARPACK-NG is a collection of Fortran77 subroutines designed to solve large scale
eigenvalue problems.
<a href="https://travis-ci.org/opencollab/arpack-ng"><img src="https://travis-ci.org/opencollab/arpack-ng.svg"/></a><br/>
[![Coverage Status](https://coveralls.io/repos/github/opencollab/arpack-ng/badge.svg?branch=master)](https://coveralls.io/github/opencollab/arpack-ng?branch=master)
Important Features:
* Reverse Communication Interface.
@@ -31,9 +34,9 @@ arpack-ng is replacing arpack almost everywhere.
The directory SRC contains the top level routines including
the highest level reverse communication interface routines
ssaupd, dsaupd - symmetric single and double precision
snaupd, dnaupd - non-symmetric single and double precision
cnaupd, znaupd - complex non-symmetric single and double precision
* ssaupd, dsaupd - symmetric single and double precision
* snaupd, dnaupd - non-symmetric single and double precision
* cnaupd, znaupd - complex non-symmetric single and double precision
The headers of these routines contain full documentation of calling
sequence and usage. Additional information is in the DOCUMENTS directory.
@@ -45,13 +48,13 @@ arpack-ng is replacing arpack almost everywhere.
data types and precisions may be found in the EXAMPLES directory.
Upon executing the 'ls EXAMPLES' command you should see
BAND
COMPLEX
NONSYM
README
SIMPLE
SVD
SYM
* BAND
* COMPLEX
* NONSYM
* README
* SIMPLE
* SVD
* SYM
Example programs for banded, complex, nonsymmetric, symmetric,
and singular value decomposition may be found in the directories
@@ -67,30 +70,63 @@ arpack-ng is replacing arpack almost everywhere.
The following instructions explain how to make the ARPACK library.
4. Unlike ARPACK, ARPACK-NG is providing autotools based build system.
Therefor, the classical:
$ sh bootstrap
$ ./configure
$ make
$ make install
should work as expected.
4. Unlike ARPACK, ARPACK-NG is providing autotools based build system
and iso_c_binding support (which enables to call fortran subroutines
natively from C or C++).
Therefore, the classical commands should work as expected:
$ sh bootstrap
$ ./configure
$ make
$ make check
$ make install
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).
To build with code coverage:
$ mkdir build
$ cd build
$ cmake -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug ..
$ make all check test coveralls
To get iso_c_binding support:
$ ./configure --enable-icb
$ cmake -D ICB=ON
The install will now provide arpack.h/hpp, parpack.h/hpp and friends.
Examples of use can be found in ./TESTS and ./PARPACK/TESTS/MPI.
A few related links can be found here:
* http://fortranwiki.org/fortran/show/ISO_C_BINDING
* http://fortranwiki.org/fortran/show/Generating+C+Interfaces
* https://www.roguewave.com/sites/rw/files/attachments/StandardizedMixedLanguageProgrammingforCandFortran.pdf
5. Within DOCUMENTS directory there are three files
ex-sym.doc
ex-nonsym.doc and
ex-complex.doc
* ex-sym.doc
* ex-nonsym.doc and
* ex-complex.doc
for templates on how to invoke the computational modes of ARPACK.
Also look in the README file for explanations concerning the
Also look in the README.MD file for explanations concerning the
other documents.
Danny Sorensen at sorensen@caam.rice.edu
Richard Lehoucq at rblehou@sandia.gov
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
Authors:
* Danny Sorensen at sorensen@caam.rice.edu
* Richard Lehoucq at rblehou@sandia.gov
* Chao Yang at cyang@lbl.gov
* Kristi Maschhoff at kristyn@tera.com
* Sylvestre Ledru at sylvestre@debian.org (current maintainer)
* Allan Cornet
Good luck and enjoy.
+18 -2
View File
@@ -1,3 +1,5 @@
AUTOMAKE_OPTIONS = subdir-objects # Needed as debug_init/icb.f90 are not in current directory.
SSRC = snaitr.f snapps.f snaup2.f snaupd.f snconv.f sneigh.f sneupd.f sngets.f sstatn.f \
ssaitr.f ssapps.f ssaup2.f ssaupd.f ssconv.f sseigt.f sseupd.f ssgets.f sstats.f \
sgetv0.f ssortc.f ssortr.f ssesrt.f sstqrb.f
@@ -12,7 +14,21 @@ CSRC = cnaitr.f cnapps.f cnaup2.f cnaupd.f cneigh.f cneupd.f cngets.f cstatn.f \
ZSRC = znaitr.f znapps.f znaup2.f znaupd.f zneigh.f zneupd.f zngets.f zstatn.f \
zgetv0.f zsortc.f
if ICB
SSRC += icbass.f90 icbasn.f90
DSRC += icbads.f90 icbadn.f90
CSRC += icbacn.f90
ZSRC += icbazn.f90
endif
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_SOURCES += $(top_builddir)/debug_init.f90
if ICB
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/debug_icb.f90
libarpack@LIBSUFFIX@_la_SOURCES += $(top_builddir)/stat_icb.f90
endif
libarpack@LIBSUFFIX@_la_LIBADD = $(top_builddir)/UTIL/libarpackutil.la $(LAPACK_LIBS) $(BLAS_LIBS)
libarpack@LIBSUFFIX@_la_LDFLAGS = -no-undefined -version-info 2:0
+9 -11
View File
@@ -239,24 +239,22 @@ c | the generalized problem when B is possibly (singular). |
c %----------------------------------------------------------%
c
call arscnd (t2)
if (bmat .eq. 'G') then
nopx = nopx + 1
ipntr(1) = 1
ipntr(2) = n + 1
call ccopy (n, resid, 1, workd, 1)
ido = -1
go to 9000
end if
nopx = nopx + 1
ipntr(1) = 1
ipntr(2) = n + 1
call ccopy (n, resid, 1, workd, 1)
ido = -1
go to 9000
end if
c
c %----------------------------------------%
c | Back from computing B*(initial-vector) |
c | Back from computing OP*(initial-vector) |
c %----------------------------------------%
c
if (first) go to 20
c
c %-----------------------------------------------%
c | Back from computing B*(orthogonalized-vector) |
c | Back from computing OP*(orthogonalized-vector) |
c %-----------------------------------------------%
c
if (orth) go to 40
@@ -271,9 +269,9 @@ c %------------------------------------------------------%
c
call arscnd (t2)
first = .TRUE.
call ccopy (n, workd(n+1), 1, resid, 1)
if (bmat .eq. 'G') then
nbx = nbx + 1
call ccopy (n, workd(n+1), 1, resid, 1)
ipntr(1) = n + 1
ipntr(2) = 1
ido = 2
+1 -1
View File
@@ -209,7 +209,7 @@ c
cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( cdum ) )
c
c %----------------%
c | Data statments |
c | Data statements |
c %----------------%
c
data first / .true. /
+1 -1
View File
@@ -26,7 +26,7 @@ c products (involving the operator OP) per Arnoldi iteration.
c The logic for adjusting is contained within the current
c subroutine.
c If ISHIFT=0, NP is the number of shifts the user needs
c to provide via reverse comunication. 0 < NP < NCV-NEV.
c to provide via reverse communication. 0 < NP < NCV-NEV.
c NP may be less than NCV-NEV since a leading block of the current
c upper Hessenberg matrix has split off and contains "unwanted"
c Ritz values.
+8 -10
View File
@@ -242,14 +242,12 @@ c | the generalized problem when B is possibly (singular). |
c %----------------------------------------------------------%
c
call arscnd (t2)
if (bmat .eq. 'G') then
nopx = nopx + 1
ipntr(1) = 1
ipntr(2) = n + 1
call dcopy (n, resid, 1, workd, 1)
ido = -1
go to 9000
end if
nopx = nopx + 1
ipntr(1) = 1
ipntr(2) = n + 1
call dcopy (n, resid, 1, workd, 1)
ido = -1
go to 9000
end if
c
c %-----------------------------------------%
@@ -259,7 +257,7 @@ c
if (first) go to 20
c
c %-----------------------------------------------%
c | Back from computing B*(orthogonalized-vector) |
c | Back from computing OP*(orthogonalized-vector) |
c %-----------------------------------------------%
c
if (orth) go to 40
@@ -276,9 +274,9 @@ c %------------------------------------------------------%
c
call arscnd (t2)
first = .TRUE.
call dcopy (n, workd(n+1), 1, resid, 1)
if (bmat .eq. 'G') then
nbx = nbx + 1
call dcopy (n, workd(n+1), 1, resid, 1)
ipntr(1) = n + 1
ipntr(2) = 1
ido = 2

Some files were not shown because too many files have changed in this diff Show More